10% pegasaas-accelerator-wp

Code Review | Pegasaas Accelerator WP

WordPress plugin Pegasaas Accelerator WP scored 10% from 54 tests.

About plugin

  • Plugin page: pegasaas-accelera...
  • Plugin version: 3.8.15
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.9.2
  • First release: Jan 16, 2019
  • Latest release: Dec 29, 2021
  • Number of updates: 184
  • Update frequency: every 5.9 days
  • Top authors: pegasaas (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

400+ active / 45,259 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/pegasaas-accelerator-wp/_inc/functions.php+75
    Undefined index: path

Server metrics [RAM: ▼2.51MB] [CPU: ▼344.90ms] Passed 4 tests

A check of server-side resources used by Pegasaas Accelerator WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.86 ▼1.665.27 ▼45.61
Dashboard /wp-admin1.88 ▼1.533.76 ▼33.19
Posts /wp-admin/edit.php1.88 ▼1.764.25 ▼32.38
Add New Post /wp-admin/post-new.php1.88 ▼5.103.77 ▼1,268.42
Media Library /wp-admin/upload.php1.88 ▼1.423.29 ▼20.64

Server storage [IO: ▲7.35MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 424 new files
Database: 7 new tables, 9 new options
New tables
wp_pegasaas_page_config
wp_pegasaas_static_asset
wp_pegasaas_performance_scan
wp_pegasaas_semaphore
wp_pegasaas_api_request
wp_pegasaas_queued_task
wp_pegasaas_page_cache
New WordPress options
pegasaas_accelerator_last_curl_ssl_test
pegasaas_last_cache_clear_queue_run
pegasaas_web_perf_score_data
pegasaas_post_types_pages
pegasaas_cloudflare_last_exists_query_time
pegasaas_accelerator_interface_load_times
pegasaas_deferred_js
pegasaas_accelerator_curl_ssl_verify
pegasaas_accelerator_last_curl_error

Browser metrics Passed 4 tests

A check of browser resources used by Pegasaas Accelerator WP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,033 ▲27617.33 ▲1.7112.26 ▲6.442.42 ▼0.22
Dashboard /wp-admin2,955 ▲1016.93 ▲0.76124.42 ▼11.31190.53 ▲28.82
Posts /wp-admin/edit.php2,926 ▲2323.49 ▲0.2574.16 ▲9.37153.56 ▲9.60
Add New Post /wp-admin/post-new.php1,828 ▲16717.22 ▲1.30427.43 ▼3.71198.66 ▲47.34
Media Library /wp-admin/upload.php1,761 ▲636.22 ▲0.70132.20 ▼13.77230.09 ▲50.12

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/pegasaas-accelerator-wp/_inc/functions.php+75
    Undefined index: path
  • Zombie tables detected upon uninstall: 7 tables
    • wp_pegasaas_static_asset
    • wp_pegasaas_semaphore
    • wp_pegasaas_page_cache
    • wp_pegasaas_queued_task
    • wp_pegasaas_api_request
    • wp_pegasaas_page_config
    • wp_pegasaas_performance_scan
  • The uninstall procedure has failed, leaving 5 options in the database
    • pegasaas_last_cache_clear_queue_run
    • pegasaas_accelerator_last_curl_ssl_test
    • pegasaas_accelerator_interface_load_times
    • pegasaas_when_ob_environment_last_checked
    • pegasaas_ob_environment_data

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 66× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/row/staging-mode-status-template.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/popovers/novice-mode-lock.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/preload_web_fonts.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/prompts/conversion-rate-change.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/popovers/diagnostic-mode.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/install-wizard/step-3.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/popovers/live-mode.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/display_level.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/prompts/disable-standard.php
    • > /wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/coverage.php
  • 1114× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: c in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/interface-handling.php on line 167
    • > PHP Fatal error
      Uncaught Error: Class 'Cloudflare\\Api' not found in wp-content/plugins/pegasaas-accelerator-wp/assets/cloudflare/Zone/KeylessSSL.php:16
    • > PHP Notice
      Undefined variable: feature_settings in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/strip_google_fonts_mobile.php on line 14
    • > PHP Notice
      Undefined variable: pegasaas in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/cdn.php on line 1
    • > PHP Notice
      Undefined variable: feature_settings in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/image_optimization.php on line 15
    • > PHP Notice
      Undefined variable: feature_settings in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/api_submit_method.php on line 72
    • > PHP Notice
      Undefined variable: pegasaas in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/prompts/wordfence-active-and-blocking.php on line 16
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/dynamic_urls.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/logging.php on line 88
    • > PHP Notice
      Undefined variable: feature in wp-content/plugins/pegasaas-accelerator-wp/_inc/admin-control-panel/settings/feature-settings/image_optimization.php on line 43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #7 (Install: Choose Experience Level), #8 (Install: Get API Key), #9 (Install: Terms of Service), #10 (Install: Choose Pages), #11 (Install: Set LIVE/Staging Mode), #12 (Installing), #13 (Dark Mode), #14 (Light Mode)
  • Tags: There are too many tags (24 tag instead of maximum 10)
You can take inspiration from this readme.txt

pegasaas-accelerator-wp/pegasaas-accelerator-wp.php 92% from 13 tests

The main PHP script in "Pegasaas Accelerator WP" version 3.8.15 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 164 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected81,332 lines of code in 326 files:
LanguageFilesBlank linesComment linesLines of code
PHP22512,2265,35438,175
CSS242,70842622,478
JavaScript223,7052,38412,651
SVG251143,528
Sass1434341,768
LESS1434441,758
HTML218614974

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,385)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity72.23
▷ Minimum class complexity1.00
▷ Maximum class complexity1,385.00
Average method complexity6.56
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces14
Interfaces0
Traits0
Classes75
▷ Abstract classes00.00%
▷ Concrete classes75100.00%
▷ Final classes00.00%
Methods959
▷ Static methods13313.87%
▷ Public methods95099.06%
▷ Protected methods70.73%
▷ Private methods20.21%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants132
▷ Global constants12796.21%
▷ Class constants53.79%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
59 PNG files occupy 1.27MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-cache.png0.47KB0.24KB▼ 48.96%
assets/images/pegasaas-accelerator-horizontal-logo-blue.png6.77KB3.31KB▼ 51.18%
assets/images/web-browser-request-resource.png17.56KB7.74KB▼ 55.95%
assets/images/play.png0.91KB0.47KB▼ 48.33%
assets/images/pegasaas-notice-light.png1.64KB0.71KB▼ 56.62%