78% amp-enhancer

Code Review | AMP Enhancer - Compatibility Layer for Official AMP Plugin

WordPress plugin AMP Enhancer - Compatibility Layer for Official AMP Plugin scored78%from 54 tests.

About plugin

  • Plugin page: amp-enhancer
  • Plugin version: 1.0.48
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 18, 2020
  • Latest release: Jun 9, 2023
  • Number of updates: 65
  • Update frequency: every 14.4 days
  • Top authors: ampenhancer (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

300+ active /13,305 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.03MB] [CPU: ▼5.17ms] Passed 4 tests

A check of server-side resources used by AMP Enhancer - Compatibility Layer for Official AMP Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.00 ▼6.56
Dashboard /wp-admin3.33 ▲0.0245.07 ▼2.08
Posts /wp-admin/edit.php3.42 ▲0.0744.10 ▼2.89
Add New Post /wp-admin/post-new.php5.92 ▲0.0480.84 ▼7.32
Media Library /wp-admin/upload.php3.25 ▲0.0235.28 ▼3.90

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 101 new files
Database: no new tables, 8 new options
New WordPress options
amp_enhancer_review_rating
amp_enhancer_install_date
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

AMP Enhancer - Compatibility Layer for Official AMP Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8216.16 ▲1.781.80 ▼0.1742.23 ▼4.50
Dashboard /wp-admin2,223 ▲356.83 ▲0.97153.81 ▲52.1343.49 ▲0.56
Posts /wp-admin/edit.php2,108 ▲194.05 ▲2.0885.56 ▲44.4135.57 ▼0.68
Add New Post /wp-admin/post-new.php1,529 ▼1325.21 ▲6.82689.80 ▲68.9536.85 ▼12.91
Media Library /wp-admin/upload.php1,408 ▲175.80 ▲1.60136.29 ▲33.8949.91 ▲5.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/amp-enhancer/pagebuilders/ux-builder/shortcodes/commons/border.php
    • > /wp-content/plugins/amp-enhancer/pagebuilders/beaver/accordion/frontend.php
    • > /wp-content/plugins/amp-enhancer/pagebuilders/beaver/tabs/frontend.php
  • 73× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/amp-enhancer/templates/cookie-law-info/views/cookie-law-info_popup_content.php:3
    • > PHP Notice
      Undefined variable: settings in wp-content/plugins/amp-enhancer/pagebuilders/beaver/tabs/frontend.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-enhancer/templates/shortcodes-ultimate/shortcodes-ultimate-functions.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/amp-enhancer/pagebuilders/ux-builder/shortcodes/ux-logo.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-enhancer/templates/cookie-law-info/cookie-law-css.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/amp-enhancer/templates/kk-star/amp-enhancer-kkstar-ajaxcalls.php:4
    • > PHP Warning
      Use of undefined constant AMP_ENHANCER_TEMPLATE_DIR - assumed 'AMP_ENHANCER_TEMPLATE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/amp-enhancer/templates/ninja-forms/amp-enhancer-ninja-forms-functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/amp-enhancer/admin/amp-enhancer-popup/amp-enhancer-popup-admin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/amp-enhancer/pagebuilders/divi/modules/Accordion.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amp-enhancer/includes/features/popup/popup-frontend.php:3

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 issues were found

Optimizations

Plugin configuration 97% 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:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4, #5 in amp-enhancer/assets to your readme.txt
You can look at the official readme.txt

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

The main file in "AMP Enhancer - Compatibility Layer for Official AMP Plugin" v. 1.0.48 serves as a complement to information provided in readme.txt and as the entry point to the plugin
103 characters long description:
AMP Enhancer is a Compatibility Layer for Official AMP Plugin ( Its Plug & Play, Requires No Settings )

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin14,446 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
PHP852,6461,73013,470
CSS7296616
JavaScript68915360

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity27.48
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.54
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes23
▷ Abstract classes521.74%
▷ Concrete classes1878.26%
▷ Final classes15.56%
Methods237
▷ Static methods4117.30%
▷ Public methods17674.26%
▷ Protected methods4719.83%
▷ Private methods145.91%
Functions148
▷ Named functions14497.30%
▷ Anonymous functions42.70%
Constants13
▷ Global constants861.54%
▷ Class constants538.46%
▷ Public constants5100.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
No PNG images were found in this plugin