84% amp-woocommerce

Code Review | AMP WooCommerce

WordPress plugin AMP WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: amp-woocommerce
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 6.3.1
  • First release: Oct 17, 2016
  • Latest release: Feb 19, 2020
  • Number of updates: 139
  • Update frequency: every 8.8 days
  • Top authors: marqas (89.93%)ahmedkaludi (10.79%)

Code review

54 tests

User reviews

12 reviews

Install metrics

200+ active /19,770 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼3.92ms] Passed 4 tests

An overview of server-side resources used by AMP WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2744.87 ▲0.32
Dashboard /wp-admin3.56 ▲0.2652.26 ▼4.41
Posts /wp-admin/edit.php3.68 ▲0.3352.05 ▼0.01
Add New Post /wp-admin/post-new.php6.15 ▲0.2688.23 ▼11.59
Media Library /wp-admin/upload.php3.49 ▲0.2640.42 ▲0.49

Server storage [IO: ▲0.38MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 43 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by AMP WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.36 ▼0.201.86 ▲0.2237.69 ▼8.79
Dashboard /wp-admin2,232 ▲575.65 ▼0.0797.06 ▼17.4345.16 ▼1.37
Posts /wp-admin/edit.php2,138 ▲381.98 ▼0.0339.81 ▲4.0935.80 ▼3.09
Add New Post /wp-admin/post-new.php1,550 ▲2223.69 ▲0.67682.11 ▼25.3453.83 ▼8.10
Media Library /wp-admin/upload.php1,431 ▲284.16 ▼0.03106.31 ▲8.4148.21 ▲5.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% 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 everything seems fine, this is not 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
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-woocommerce/inc/amp_woo_features.php:214
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-woocommerce/inc/amp_woo_ajax_calls.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/amp-woocommerce/templates/layouts/single.php:4
    • > PHP Notice
      Undefined variable: amp_blacklist_sanitizer in wp-content/plugins/amp-woocommerce/inc/class-amp-woo-blacklist.php on line 8
    • > PHP Warning
      Use of undefined constant AMP_WOO_INC_DIR - assumed 'AMP_WOO_INC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-woocommerce/inc/class-amp-woo-add-to-cart.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/amp-woocommerce/templates/layouts/product-review.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
2 plugin tags: amp, woocommerce

amp-woocommerce/amp-woocommerce.php 92% from 13 tests

The main PHP file in "AMP WooCommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 160 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin5,132 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP244803214,973
JavaScript115159
SVG30056
Markdown19044

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity39.33
▷ Minimum class complexity12.00
▷ Maximum class complexity57.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods825.00%
▷ Protected methods1546.88%
▷ Private methods928.12%
Functions36
▷ Named functions3494.44%
▷ Anonymous functions25.56%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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
2 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/home.png0.83KB0.58KB▼ 29.88%
assets/placeholder.png15.33KB11.36KB▼ 25.86%