10% amp-toolbox

Code Review | AMP Toolbox

WordPress plugin AMP Toolbox scored 10% from 54 tests.

About plugin

  • Plugin page: amp-toolbox
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 5.9.2
  • First release: May 5, 2016
  • Latest release: Jan 25, 2021
  • Number of updates: 27
  • Update frequency: every 63.9 days
  • Top authors: deano1987 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 8,499 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/amp-toolbox/WDPanelAdmin.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; WDPanelAdmin2 has a deprecated constructor

Server metrics [RAM: ▼2.36MB] [CPU: ▼351.57ms] Passed 4 tests

A check of server-side resources used by AMP Toolbox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.01 ▼1.5110.19 ▼47.48
Dashboard /wp-admin2.03 ▼1.384.29 ▼30.94
Posts /wp-admin/edit.php2.03 ▼1.615.40 ▼87.60
Add New Post /wp-admin/post-new.php2.03 ▼4.945.51 ▼1,240.24
Media Library /wp-admin/upload.php2.03 ▼1.278.31 ▼18.32
AMP Toolbox /wp-admin/options-general.php?page=amp-toolbox2.035.85

Server storage [IO: ▲0.19MB] [DB: ▲0.35MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 1 new option
New WordPress options
amp_toolbox_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for AMP Toolbox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,294 ▼46315.86 ▲0.154.43 ▼1.4132.77 ▲30.21
Dashboard /wp-admin2,897 ▲406.15 ▲0.00121.40 ▼17.23156.42 ▼13.13
Posts /wp-admin/edit.php2,662 ▼263.24 ▲0.0164.24 ▲2.47139.09 ▼6.10
Add New Post /wp-admin/post-new.php1,755 ▲9421.48 ▲5.61454.43 ▲16.18156.48 ▲5.87
Media Library /wp-admin/upload.php1,703 ▲55.53 ▼0.01145.27 ▲0.76199.12 ▲7.53
AMP Toolbox /wp-admin/options-general.php?page=amp-toolbox1,8474.6983.64183.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/amp-toolbox/WDPanelAdmin.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; WDPanelAdmin2 has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 option in the database
    • amp_toolbox_settings

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=amp-toolbox
    • > Deprecated in wp-content/plugins/amp-toolbox/WDPanelAdmin.php+9
    Methods with the same name as their class will not be constructors in a future version of PHP; WDPanelAdmin2 has a deprecated constructor
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=amp-toolbox
    • > User deprecated in wp-includes/functions.php+5316
    clean_url is deprecated since version 3.0.0! Use esc_url() instead.

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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/amp-toolbox/css-tidy/css_optimiser.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/amp-toolbox/amp-toolbox.php:60
    • > PHP Notice
      Undefined index: template in wp-content/plugins/amp-toolbox/css-tidy/css_optimiser.php on line 153

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: You should set the name of your plugin on the first line ( === amp-toolbox === )
You can look at the official readme.txt

amp-toolbox/amp-toolbox.php Passed 13 tests

The primary PHP file in "AMP Toolbox" version 2.1.1 is used by WordPress to initiate all plugin functionality
123 characters long description:
This is a plugin that extends and fixes functionality from the AMP plugin, allowing you a better control of your AMP pages.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected2,888 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP83958032,868
CSS15020

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 134)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity86.20
▷ Minimum class complexity18.00
▷ Maximum class complexity186.00
Average method complexity7.76
▷ Minimum method complexity1.00
▷ Maximum method complexity134.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods63
▷ Static methods00.00%
▷ Public methods63100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
WebDesiresLogo.png11.52KB6.82KB▼ 40.82%
email_sub.png2.60KB1.63KB▼ 37.49%
cloud.png14.59KB0.46KB▼ 96.85%
rss.png16.96KB9.09KB▼ 46.38%