73% a2-optimized-wp

Code Review | A2 Optimized WP

WordPress plugin A2 Optimized WP scored 73% from 54 tests.

About plugin

  • Plugin page: a2-optimized-wp
  • Plugin version: 2.1.3.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.9
  • WordPress version: 5.9.2
  • First release: Oct 8, 2015
  • Latest release: Mar 21, 2022
  • Number of updates: 126
  • Update frequency: every 18.7 days
  • Top authors: a2hosting (94.44%)A2BCool (6.35%)

Code review

54 tests

User reviews

35 reviews

Install metrics

50,000+ active / 779,077 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.03MB] [CPU: ▼287.56ms] Passed 4 tests

This is a short check of server-side resources used by A2 Optimized WP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.55 ▲1.0465.44 ▲14.62
Dashboard /wp-admin4.43 ▲1.0242.76 ▲9.89
Posts /wp-admin/edit.php4.72 ▲1.0742.52 ▲4.83
Add New Post /wp-admin/post-new.php7.96 ▲0.98100.63 ▼1,170.55
Media Library /wp-admin/upload.php4.37 ▲1.0731.47 ▲5.58

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

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • Illegal file modification found: 3 files (0.51KB) outside of "wp-content/plugins/a2-optimized-wp/" and "wp-content/uploads/"
    • (new file) 403.shtml
    • (new file) 404.shtml
    • (modified) .htaccess
Filesystem: 45 new files
Database: no new tables, 2 new options
New WordPress options
A2_Optimized_Plugin__installed
A2_Optimized_Plugin__version

Browser metrics Passed 4 tests

This is an overview of browser requirements for A2 Optimized WP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,979 ▲22516.19 ▲0.566.36 ▲0.532.09 ▼0.46
Dashboard /wp-admin3,104 ▲2436.02 ▼0.14120.68 ▼17.59196.50 ▲34.57
Posts /wp-admin/edit.php2,715 ▲243.24 ▲0.0065.73 ▲1.43133.54 ▼11.88
Add New Post /wp-admin/post-new.php1,734 ▲7322.86 ▲5.75396.43 ▼10.37156.28 ▲0.07
Media Library /wp-admin/upload.php1,728 ▲335.54 ▲0.03145.53 ▲4.75186.75 ▲4.59

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/a2-optimized-wp/A2_Optimized_CacheDisk.php+971
    unlink(wp-content/settings/a2opt-cache/wp.com.php): No such file or directory
  • This plugin does not fully uninstall, leaving 2 options in the database
    • A2_Optimized_Plugin__installed
    • A2_Optimized_Plugin__version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/a2-optimized-wp/object-cache.php:520

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: hosting, optimize, lscache, a2, litespeed...

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

The main PHP file in "A2 Optimized WP" ver. 2.1.3.10 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("a2-optimized-wp.php" instead of "a2-optimized.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected10,674 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP131,3221,6676,159
CSS526293,678
JSON100387
SVG100288
JavaScript35643162

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity73.75
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes325.00%
Methods315
▷ Static methods9730.79%
▷ Public methods22772.06%
▷ Protected methods268.25%
▷ Private methods6219.68%
Functions77
▷ Named functions1418.18%
▷ Anonymous functions6381.82%
Constants14
▷ Global constants857.14%
▷ Class constants642.86%
▷ Public constants6100.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
7 PNG files occupy 0.70MB with 0.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/background-left.png79.83KB36.39KB▼ 54.41%
assets/images/brankic1979-icon-set.png216.14KB76.76KB▼ 64.48%
assets/images/background-right.png75.20KB35.10KB▼ 53.33%
assets/images/background-both.png157.94KB72.64KB▼ 54.01%
assets/images/a2optimized.png9.71KB5.12KB▼ 47.22%