67% a2-optimized-wp

Code Review | A2 Optimized WP - Turbocharge and secure your WordPress site

WordPress plugin A2 Optimized WP - Turbocharge and secure your WordPress site scored67%from 54 tests.

About plugin

  • Plugin page: a2-optimized-wp
  • Plugin version: 3.0.7.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 8, 2015
  • Latest release: Nov 22, 2023
  • Number of updates: 226
  • Update frequency: every 13.1 days
  • Top authors: a2hosting (96.9%)A2BCool (3.54%)

Code review

54 tests

User reviews

39 reviews

Install metrics

70,000+ active /1,595,348 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.24MB] [CPU: ▲9.76ms] Passed 4 tests

An overview of server-side resources used by A2 Optimized WP - Turbocharge and secure your WordPress site
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.54 ▲1.0749.82 ▲8.14
Dashboard /wp-admin4.64 ▲1.3455.06 ▲4.43
Posts /wp-admin/edit.php4.69 ▲1.3461.03 ▲11.35
Add New Post /wp-admin/post-new.php7.16 ▲1.27102.82 ▲22.38
Media Library /wp-admin/upload.php4.50 ▲1.2748.10 ▲15.11
Optimization /wp-admin/admin.php?page=a2-optimized&a2_page=optimizations4.7864.33
Page Load Speed Score /wp-admin/admin.php?page=a2-optimized4.7753.86
Website and Server Performance /wp-admin/admin.php?page=a2-optimized&a2_page=server_performance4.7751.29

Server storage [IO: ▲1.80MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
It is recommended to fix the following issues
  • You have illegally modified 2 files (0.66KB) outside of "wp-content/plugins/a2-optimized-wp/" and "wp-content/uploads/"
    • (new file) wp-content/settings/a2opt-cache/.htaccess
    • (new file) wp-content/settings/a2opt-cache/wp.com.php
Filesystem: 86 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
a2_litespeed_lock
widget_theysaidso_widget
a2opt-cache
a2_db_optimizations
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for A2 Optimized WP - Turbocharge and secure your WordPress site
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7314.32 ▼0.391.79 ▲0.0141.13 ▼2.43
Dashboard /wp-admin2,243 ▲655.72 ▲0.0395.41 ▼17.5741.20 ▼1.04
Posts /wp-admin/edit.php2,145 ▲451.98 ▼0.1440.03 ▼0.0636.53 ▲1.34
Add New Post /wp-admin/post-new.php1,549 ▲2323.33 ▼0.08681.23 ▲78.0057.49 ▲7.46
Media Library /wp-admin/upload.php1,445 ▲484.21 ▲0.0098.13 ▼1.1342.14 ▼2.32
Optimization /wp-admin/admin.php?page=a2-optimized&a2_page=optimizations1,6033.7776.87104.50
Page Load Speed Score /wp-admin/admin.php?page=a2-optimized1,6033.7574.4547.01
Website and Server Performance /wp-admin/admin.php?page=a2-optimized&a2_page=server_performance1,6053.8670.4449.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/a2-optimized-wp/core/A2_Optimized_CacheDisk.php+981
    rmdir(wp-content/settings/a2opt-cache): Directory not empty
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • a2_litespeed_lock
    • widget_recent-posts
    • theysaidso_admin_options
    • a2opt-cache
    • a2_db_optimizations
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/a2-optimized-wp/app/templates/admin/errors/requirements-error.php
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Trait 'A2_Optimized\\Core\\Registry\\Base_Registry' not found in wp-content/plugins/a2-optimized-wp/core/registry/class-model.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'A2_Optimized\\Core\\Model' not found in wp-content/plugins/a2-optimized-wp/app/models/class-settings.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/a2-optimized-wp/app/templates/admin/page-settings/page-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/a2-optimized-wp/app/templates/admin/page-settings/page-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'A2_Optimized\\App\\Controllers\\Admin\\Base_Controller' not found in wp-content/plugins/a2-optimized-wp/app/controllers/admin/class-admin-settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/a2-optimized-wp/app/templates/admin/page-settings/page-settings-fields.php:1
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/a2-optimized-wp/app/templates/admin/page-settings/page-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'A2_Optimized\\App\\Models\\Admin\\Base_Model' not found in wp-content/plugins/a2-optimized-wp/app/models/admin/class-admin-settings.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'A2_Optimized\\Core\\Controller' not found in wp-content/plugins/a2-optimized-wp/app/controllers/admin/class-base-controller.php:15
    • > PHP Notice
      Undefined variable: errors in wp-content/plugins/a2-optimized-wp/app/templates/admin/errors/requirements-error.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
You can look at the official readme.txt

a2-optimized-wp/a2-optimized.php 85% from 13 tests

This is the main PHP file of "A2 Optimized WP - Turbocharge and secure your WordPress site" version 3.0.7.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("a2-optimized-wp.php" instead of "a2-optimized.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected27,978 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript86052,17912,045
PHP441,7702,8688,499
CSS63535,714
Sass121321,027
JSON100405
SVG100288

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity36.81
▷ Minimum class complexity1.00
▷ Maximum class complexity274.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity95.00
Code structure
Namespaces8
Interfaces0
Traits1
Classes31
▷ Abstract classes39.68%
▷ Concrete classes2890.32%
▷ Final classes310.71%
Methods366
▷ Static methods12935.25%
▷ Public methods25870.49%
▷ Protected methods215.74%
▷ Private methods8723.77%
Functions24
▷ Named functions1979.17%
▷ Anonymous functions520.83%
Constants34
▷ Global constants823.53%
▷ Class constants2676.47%
▷ Public constants26100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin/wave-success.png1.61KB0.83KB▼ 48.02%
(invalid) assets/images/admin/wave-warn.png2.85KB0.00KB▼ 100.00%
assets/images/admin/a2opt-logo-2022.png11.34KB4.28KB▼ 62.23%
assets/images/admin/wave-danger.png1.51KB0.80KB▼ 46.79%
assets/images/admin/wave-empty.png2.80KB1.51KB▼ 45.92%