Skip to content

Commit

Permalink
Merge pull request #208 from shakee93/old-onboard/changes
Browse files Browse the repository at this point in the history
Old onboard/changes
  • Loading branch information
azeezs2012 authored Dec 5, 2024
2 parents 9893afb + 628ecd2 commit 11a179f
Show file tree
Hide file tree
Showing 44 changed files with 725 additions and 526 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/deploy-wordpress-plugin-preview-linode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,6 @@ jobs:
sudo docker exec -u root -i \${WP_CONTAINER} sh -c "chmod 666 /bitnami/wordpress/wp-config.php"
EOF
- name: Create cache folder and grant 755 permissions
if: ${{ github.event.action == 'opened' }}
run: |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} << EOF
set -x
INSTANCE_ID=${{ github.event.number }}
DOMAIN="pr-${INSTANCE_ID}.rapidload.live"
WP_CONTAINER=\$(sudo docker ps -q --filter "name=wordpress_\${INSTANCE_ID}")
# Create cache folder if it doesn't exist and grant 755 permissions
sudo docker exec -u root -i \${WP_CONTAINER} sh -c "if [ ! -d /bitnami/wordpress/wp-content/cache ]; then mkdir -p /bitnami/wordpress/wp-content/cache; fi && chmod -R 775 /bitnami/wordpress/wp-content/cache && chown daemon:daemon /bitnami/wordpress/wp-content/cache"
EOF
- name: Update domain in wp-config.php
if: ${{ github.event.action == 'opened' }}
run: |
Expand Down Expand Up @@ -283,6 +270,7 @@ jobs:
if [ -d ${PLUGIN_PATH} ]; then
echo 'Plugin directory exists. Running git pull...'
cd ${PLUGIN_PATH}
git config --global --add safe.directory /bitnami/wordpress/wp-content/plugins/autoptimize-unusedcss
git clean -f
git reset --hard HEAD
git pull origin ${{ github.head_ref }}
Expand Down Expand Up @@ -360,6 +348,19 @@ jobs:
sudo docker exec -u root -i ${WP_CONTAINER} sh -c "echo \"define('DISALLOW_FILE_MODS', true);\" >> /bitnami/wordpress/wp-config.php"
EOF
- name: Grant permission to daemon user
if: ${{ github.event.action == 'opened' }}
run: |
ssh -v -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa root@${{ secrets.SSH_HOST_LINODE }} << EOF
set -x
INSTANCE_ID=${{ github.event.number }}
DOMAIN="pr-${INSTANCE_ID}.rapidload.live"
WP_CONTAINER=\$(sudo docker ps -q --filter "name=wordpress_\${INSTANCE_ID}")
# Grant permission to daemon user
sudo docker exec -u root \$WP_CONTAINER sh -c 'chown -R daemon:daemon /bitnami/wordpress'
EOF
- name: Clean up old Docker containers and volumes
#if: ${{ github.event.action == 'opened' }}
run: |
Expand Down
20 changes: 11 additions & 9 deletions assets/js/uucss_admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
rule_based_status +
'</select>');

var input = '<div class="uucss-url-search-wrap"><input type="search" placeholder="Search" value="'+ url_filter +'"><input class="uucss_search_exact" type="checkbox" id="uucss_search_exact" value="1"></div>';
var input = '<div class="uucss-url-search-wrap url-history"><input type="search" placeholder="Search" value="'+ url_filter +'"><input class="uucss_search_exact" type="checkbox" id="uucss_search_exact" value="1"></div>';
$(input).prependTo($('#uucss-history_info'));

$(select).prependTo($('#uucss-history_info'));
Expand All @@ -337,8 +337,8 @@
appendTo: 'parent',
});

var $url_input = $('#uucss-history_info input[type="search"]')
var $exact_search = $('#uucss-history_info input.uucss_search_exact')
var $url_input = $('#uucss-history_info .uucss-url-search-wrap.url-history input[type="search"]')
var $exact_search = $('#uucss-history_info .uucss-url-search-wrap.url-history input.uucss_search_exact')

$url_input.on('input',function () {
url_filter = $(this).val();
Expand Down Expand Up @@ -425,7 +425,7 @@
'<option value="failed" ' + (status_filter_rule === 'failed'? 'selected' : '') +'>Failed</option>' +
'</select>');

var input = '<div class="uucss-url-search-wrap"><input type="search" placeholder="Search" value="'+ url_filter +'"><input class="uucss_search_exact" type="checkbox" id="uucss_search_exact_rule" value="1"></div>';
var input = '<div class="uucss-url-search-wrap rule-history"><input type="search" placeholder="Search" value="'+ url_filter +'"><input class="uucss_search_exact" type="checkbox" id="uucss_search_exact_rule" value="1"></div>';
$(input).prependTo($('#uucss-rule-history_info'));

$(select).prependTo($('#uucss-rule-history_info'));
Expand All @@ -442,8 +442,8 @@
appendTo: 'parent',
});*/

var $input = $('#uucss-rule-history_info input[type="search"]')
var $exact_search = $('#uucss-rule-history_info input.uucss_search_exact')
var $input = $('#uucss-rule-history_info .uucss-url-search-wrap.rule-history input[type="search"]')
var $exact_search = $('#uucss-rule-history_info .uucss-url-search-wrap.rule-history input.uucss_search_exact')

$input.on('input',function () {
url_filter_rule = $(this).val();
Expand Down Expand Up @@ -1332,9 +1332,11 @@
}

if(!window.uucss || !window.uucss.uucss_enable_debug){
rowData.meta.warnings = rowData.meta.warnings.filter(function(w){
return !w.message.toString().includes('optimized version for the file missing')
})
if(rowData.meta?.warnings?.length){
rowData.meta.warnings = rowData.meta.warnings.filter(function(w){
return !w.message.toString().includes('optimized version for the file missing')
})
}
}

/*if(rowData.meta.warnings && rowData.meta.warnings.length){
Expand Down
2 changes: 1 addition & 1 deletion assets/js/uucss_admin.min.js

Large diffs are not rendered by default.

14 changes: 11 additions & 3 deletions includes/RapidLoad_Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public static function enqueueGlobalScript() {
'on_board_complete' => apply_filters('uucss/on-board/complete', false),
'home_url' => home_url(),
'api_url' => RapidLoad_Api::get_key(),
'nonce' => wp_create_nonce( 'uucss_nonce' ),
'nonce' => self::create_nonce( 'uucss_nonce' ),
'active_modules' => (array)self::get()->modules()->active_modules(),
'notifications' => apply_filters('uucss/notifications', []),
'activation_url' => self::activation_url('authorize' ),
Expand Down Expand Up @@ -598,10 +598,10 @@ public static function get_default_options(){
'uucss_keyframes' => "1",
'uucss_variables' => "1",
'uucss_enable_uucss' => "1",
'uucss_enable_cpcss' => "1",
'uucss_enable_cpcss' => "0",
'uucss_enable_cpcss_mobile' => "1",
'uucss_minify' => "1",
'uucss_support_next_gen_formats' => "1",
'uucss_support_next_gen_formats' => "0",
'uucss_set_width_and_height' => "1",
'uucss_self_host_google_fonts' => "1",
'uucss_image_optimize_level' => "lossless",
Expand All @@ -610,6 +610,14 @@ public static function get_default_options(){
'rapidload_test_mode' => "1",
'rapidload_cpcss_file_character_length' => 0,
'uucss_adaptive_image_delivery' => "1",
'uucss_load_js_method' => "1",
'uucss_lazy_load_images' => "1",
'minify_js' => "1",
'uucss_enable_cache' => "1",
'uucss_enable_cdn' => "1",
'update_htaccess_file' => "0",
'uucss_lazy_load_iframes' => "1"

];
}

Expand Down
Loading

0 comments on commit 11a179f

Please sign in to comment.