Settings', AOMIN_PLUGIN_IDENTIFIER)), array('tab2', 'all-in-one-minifier-report', 'fa-chart-line', __(' Page Speed Report', AOMIN_PLUGIN_IDENTIFIER)), array('tab3', 'all-in-one-minifier-about', 'fa-info-circle', __(' About', AOMIN_PLUGIN_IDENTIFIER)), array('tab4', 'all-in-one-minifier-donate', 'fa-info-circle', __(' Donate', AOMIN_PLUGIN_IDENTIFIER)) ); $menu = null; foreach ($list as $item => $value) { $menu .= '
' . $value[3] . '
'; } echo wp_kses_post($menu); } /** * Register the stylesheet file(s) for the dashboard area */ public function enqueue_backend_standalone() { wp_register_style($this->plugin_name . '-standalone', plugin_dir_url(__FILE__) . 'assets/styles/standalone.css', array(), $this->version, 'all'); wp_enqueue_style($this->plugin_name . '-standalone'); } /** * Update `Options` on form submit */ public function return_update_options() { if ((isset($_POST['all-in-one-minifier-update-option'])) && ($_POST['all-in-one-minifier-update-option'] == 'true') && check_admin_referer('pwm-referer-form', 'pwm-referer-option') ) { $opts = array('start_minify' => 'off', 'admin' => 'off', 'loadtime' => 'off'); if (isset($_POST['_all-in-one_minifier']['start_minify'])) { $opts['start_minify'] = 'on'; } // if(isset($_POST['_all-in-one_minifier']['admin'])) // { // $opts['admin'] = 'on'; // } // if(isset($_POST['_all-in-one_minifier']['loadtime'])) // { // $opts['loadtime'] = 'on'; // } $data = update_option('_all-in-one_minifier', $opts); header('location:' . admin_url('admin.php?page=all-in-one-minifier-admin') . '&status=updated'); die(); } } /** * Return the `Options` page */ public function return_options_page() { $this->_getJSReady(); $opts = get_option('_all-in-one_minifier'); if ((isset($_GET['status'])) && ($_GET['status'] == 'updated')) { $notice = array('success', __('Your settings have been successfully updated.', AOMIN_PLUGIN_IDENTIFIER)); } $allPostTypes = array(); $args = array( 'public' => true, ); $post_types = get_post_types($args, 'objects'); foreach ($post_types as $post_type_obj): if ($post_type_obj->name != 'attachment') { array_push($allPostTypes, $post_type_obj->name); } endforeach; $wc_query = new WP_Query(array( 'post_type' => $allPostTypes, 'post_status' => 'publish', 'posts_per_page' => -1 )); $allPostData = array(); if ($wc_query->have_posts()) { while ($wc_query->have_posts()) { $wc_query->the_post(); $post_id = get_the_ID(); $allPostData[] = ['post_id' => $post_id]; } } $disablePluginOption = ''; $frontpage_id = get_option('page_on_front'); if (!isset($opts['start_minify']) || ($opts['start_minify']) == 'off') { $disablePluginOption = 'alone-disabled-options'; } if ($frontpage_id == '' || $frontpage_id == '0') { $disablePluginOption = 'alone-disabled-options'; } ?>
return_plugin_header()); ?>
return_tabs_menu('tab1')); ?>
×
×
×


0) { ?> href="javascript:_runCache()" > Generate Cache

for urls prefix . 'alone_minifier_analysis'; $querystr = "SELECT datetime FROM $table_name WHERE 1 = 1 LIMIT 1 "; $pageposts = $wpdb->get_results($querystr, OBJECT); if (count($pageposts) > 0) { ?> last cache on datetime))); ?>
' . __(AOMIN_PLUGIN_FULLNAME, AOMIN_PLUGIN_IDENTIFIER) . ''; return $html; } /** * Return the `About` page */ public function return_about_page() { ?>
return_plugin_header()); ?>
return_tabs_menu('tab3')); ?>
Mahesh Thorat

© - created by Mahesh Mohan Thorat

= 1073741824) { $bytes = number_format($bytes / 1073741824, 2) . ' GB'; } elseif ($bytes >= 1048576) { $bytes = number_format($bytes / 1048576, 2) . ' MB'; } elseif ($bytes >= 1024) { $bytes = number_format($bytes / 1024, 2) . ' KB'; } elseif ($bytes > 1) { $bytes = $bytes . ' bytes'; } elseif ($bytes == 1) { $bytes = $bytes . ' byte'; } else { $bytes = '0 bytes'; } return $bytes; } public function return_generate_loadTime_report() { $this->_getJSReady(); $opts = get_option('_all-in-one_minifier'); $disablePluginOption = ''; $frontpage_id = get_option('page_on_front'); if (!isset($opts['start_minify']) || ($opts['start_minify']) == 'off') { $disablePluginOption = 'alone-disabled-options'; } if ($frontpage_id == '' || $frontpage_id == '0') { $disablePluginOption = 'alone-disabled-options'; } ?>
return_plugin_header()); ?>
return_tabs_menu('tab2')); ?> true, ); $post_types = get_post_types($args, 'objects'); foreach ($post_types as $post_type_obj): if ($post_type_obj->name != 'attachment') { array_push($allPostTypes, $post_type_obj->name); } endforeach; } else { array_push($allPostTypes, $_GET['filter-post-type']); } $paged = @$_GET['paged']; set_query_var('paged', $paged); $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wpposts = new WP_Query( array( 'post_type' => $allPostTypes, 'posts_per_page' => 10, 'paged' => $paged, 'post_status' => 'publish', 'orderby' => 'title', 'order' => 'ASC' ) ); if ($frontpage_id == '' || $frontpage_id == '0') { ?>
generatePagination($wpposts); ?> have_posts()) : $wpposts->the_post(); $postID = get_the_ID(); $post_title = get_the_title(); $post_link = get_permalink($postID); $current_queried_post_type = get_post_type($postID); $docBeforeTimePrint = ''; $docAfterTimePrint = ''; $bef_docBeforeTime = ''; $bef_docAfterTime = ''; $af_docBeforeTime = ''; $af_docAfterTime = ''; global $wpdb; $table_name = $wpdb->prefix . 'alone_minifier_analysis'; $querystr_1 = "SELECT postID, docBeforeTime, docAfterTime, minifyStatus, datetime FROM $table_name WHERE postID = $postID ORDER BY minifyStatus "; $pageposts_1 = $wpdb->get_results($querystr_1, OBJECT); $array_1 = array(); foreach ($pageposts_1 as $value_1) { $docBeforeTime = $value_1->docBeforeTime; $docAfterTime = $value_1->docAfterTime; $minifyStatus = $value_1->minifyStatus; $datetime = $value_1->datetime; $af_docBeforeTime = $docBeforeTime; $af_docAfterTime = $docAfterTime; $docBeforeTimePrint .= 'Before : ' . esc_attr($this->AIOMformatSizeUnits($docBeforeTime)) . ''; $docAfterTimePrint .= 'After : ' . esc_attr($this->AIOMformatSizeUnits($docAfterTime)) . ''; } $minifiedPerComp = ''; $minifiedPerPrint = ''; if ($af_docAfterTime != '' && $af_docBeforeTime != '') { $minifiedPerComp = ($af_docAfterTime / $af_docBeforeTime) * 100; $minifiedPerComp = $minifiedPerComp - 100; $minifiedPerComp = abs($minifiedPerComp); $minifiedPerReadyClass = 'color_red'; $minifiedPerCompClass = 'color_red'; if ($af_docBeforeTime > $af_docafterTime) { $minifiedPerCompClass = 'color_green'; } $minifiedPerPrint .= '' . number_format($minifiedPerComp, 2) . ' %'; } ?> have_posts()) { ?>
Page Page Before Optimization Page After Optimization Minified % Date
href="javascript:_buildCache(, -1)" class="row-title"> —
Last cache on
Build cache for this
href="javascript:_buildCache(, -1)" class="row-title">Click here
No records found.
Page Page Ready Time Page Completely Loaded Minified % Date
generatePagination($wpposts); ?>
Post Type
found_posts); ?> items
str_replace( $big, '%#%', get_pagenum_link( $big ) ), 'base' => $pageUrl, 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $wpposts->max_num_pages ))); ?>
return_plugin_header()); ?>
return_tabs_menu('tab4')); ?>

Scan below code



Mr Mahesh Mohan Thorat

UPI - maheshmthorat@oksbi

0) { ?>

Please wait while we generating report for this page.

This will take less than a minute.
Note - Page will reload several times to generate report

Generating without web optimizations
Generating with web optimizations
Cancel Report
prefix . 'alone_minifier_analysis'; $querystr_1 = "SELECT postID, docBeforeTime, docAfterTime, minifyStatus, datetime FROM $table_name WHERE postID = $postID ORDER BY minifyStatus "; $pageposts_1 = $wpdb->get_results($querystr_1, OBJECT); $array_1 = array(); foreach ($pageposts_1 as $value_1) { $docBeforeTime = $value_1->docBeforeTime; $docAfterTime = $value_1->docAfterTime; $minifyStatus = $value_1->minifyStatus; $datetime = $value_1->datetime; if ($minifyStatus == 0) { $bef_docBeforeTime = $docBeforeTime; $bef_docAfterTime = $docAfterTime; $docBeforeTimePrint .= 'Before : ' . $docBeforeTime . ' Sec
'; $docAfterTime .= 'Before : ' . $docAfterTime . ' Sec
'; } if ($minifyStatus == 1) { $af_docBeforeTime = $docBeforeTime; $af_docAfterTime = $docAfterTime; $docBeforeTimePrint .= 'After : ' . $docBeforeTime . ' Sec'; $docAfterTime .= 'After : ' . $docAfterTime . ' Sec'; } } $minifiedPerReady = ''; $minifiedPerComp = ''; $minifiedPerPrint = ''; if ($bef_docBeforeTime != '' && $bef_docAfterTime != '' && $af_docBeforeTime != '' && $af_docAfterTime != '') { $minifiedPerReady = ($bef_docBeforeTime / $af_docBeforeTime) * 100; $minifiedPerComp = ($bef_docAfterTime / $af_docAfterTime) * 100; $minifiedPerReadyClass = 'color_red'; $minifiedPerCompClass = 'color_red'; if ($bef_docBeforeTime > $af_docBeforeTime) { $minifiedPerReadyClass = 'color_green'; } if ($bef_docAfterTime > $af_docAfterTime) { $minifiedPerCompClass = 'color_green'; } $minifiedPerPrint = 'Page Ready : ' . number_format($minifiedPerReady, 2) . ' %'; $minifiedPerPrint .= '
Page Complete : ' . number_format($minifiedPerComp, 2) . ' %'; } $backBtnLink = admin_url('admin.php') . '?page=all-in-one-minifier-report'; ?>

Page Speed Report

Page Ready Time
Page Completely Loaded
Minified %
Close Report Back to All Report Re-Scan Page
" . __('Settings') . ''; array_push( $links, $settings_link ); return $links; } } add_action('wp_ajax_actionBuildCache', 'buildCacheAjax'); add_action('wp_ajax_actionBuildCache', 'buildCacheAjax'); function buildCacheAjax() { if (isset($_POST['post_id'])) { $post_id = @$_POST['post_id']; } if ($post_id != '') { $post_slug = get_post_field('post_name', $post_id); $permalink = get_permalink($post_id); $frontpage_id = get_option('page_on_front'); if ($post_id == $frontpage_id) { $post_slug = 'index'; } $arrContextOptions = array( "ssl" => array( "verify_peer" => false, "verify_peer_name" => false, ), ); if (file_exists(AOMIN_PLUGIN_ABS_CACHE_PATH . $post_slug . ".html")) { unlink(AOMIN_PLUGIN_ABS_CACHE_PATH . $post_slug . ".html"); } $content = file_get_contents($permalink . "?isMinify=false", false, stream_context_create($arrContextOptions)); $withoutSanitize = file_put_contents(AOMIN_PLUGIN_ABS_CACHE_PATH . $post_slug . ".html", $content); unlink(AOMIN_PLUGIN_ABS_CACHE_PATH . $post_slug . ".html"); $withSanitize = file_put_contents(AOMIN_PLUGIN_ABS_CACHE_PATH . $post_slug . ".html", sanitize_output($content)); global $wpdb; $datetime = date('Y-m-d H:i:s'); $minifyStatus = 1; $table_name = $wpdb->prefix . 'alone_minifier_analysis'; $querystr = "SELECT postID FROM $table_name WHERE postID = $post_id LIMIT 1 "; $pageposts = $wpdb->get_results($querystr, OBJECT); if (count($pageposts) > 0) { $wpdb->query($wpdb->prepare("UPDATE $table_name SET docBeforeTime = '$withoutSanitize', docAfterTime = '$withSanitize', datetime = '$datetime' WHERE postID = $post_id AND minifyStatus = $minifyStatus ")); } else { $wpdb->insert($table_name, array('postID' => $post_id, 'minifyStatus' => $minifyStatus, 'docBeforeTime' => $withoutSanitize, 'docAfterTime' => $withSanitize, 'datetime' => $datetime)); } } }