61% wp-amp-lite

Code Review | WP AMP Lite

WordPress plugin WP AMP Lite scored61%from 54 tests.

About plugin

  • Plugin page: wp-amp-lite
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Dec 24, 2019
  • Latest release: Dec 24, 2019
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: custom4web (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /744 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.81MB] [CPU: ▼37.13ms] Passed 4 tests

An overview of server-side resources used by WP AMP Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.38 ▲0.9235.55 ▼5.67
Dashboard /wp-admin3.13 ▼0.1719.79 ▼27.85
Posts /wp-admin/edit.php3.13 ▼0.2218.32 ▼28.07
Add New Post /wp-admin/post-new.php3.13 ▼2.7519.08 ▼74.73
Media Library /wp-admin/upload.php3.13 ▼0.1018.62 ▼17.88
WP AMP /wp-admin/options-general.php?page=amphtml-options3.1321.77

Server storage [IO: ▲0.91MB] [DB: ▲0.13MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 111 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
amphtml_version
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP AMP Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,988 ▲25315.29 ▲0.521.61 ▼0.2636.85 ▼8.64
Dashboard /wp-admin2,396 ▲2057.09 ▲1.19144.77 ▲42.6440.78 ▼3.33
Posts /wp-admin/edit.php2,302 ▲2133.61 ▲1.6055.25 ▲20.5232.01 ▼4.79
Add New Post /wp-admin/post-new.php6,364 ▲4,83120.04 ▼3.21833.05 ▲155.8035.20 ▼17.80
Media Library /wp-admin/upload.php1,441 ▲534.86 ▲0.6485.72 ▼16.9441.31 ▼3.37
WP AMP /wp-admin/options-general.php?page=amphtml-options1,4783.9669.0330.52

Uninstaller [IO: ▲0.00MB] [DB: ▲0.13MB] 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 cannot be uninstalled
    • > Notice in wp-content/plugins/wp-amp-lite/includes/tabs/class-amphtml-tab-general.php+60
    Undefined variable: section
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=amphtml-options
    • > Notice in wp-content/plugins/wp-amp-lite/includes/tabs/class-amphtml-tab-general.php+60
    Undefined variable: section

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-amp-lite/templates/amp-boilerplate.php
  • 58× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/wp-amp-lite/templates/parts/content_404.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-amp-lite/templates/base.php:10
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/related-posts.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/parts/wc_archives_image.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/social-share.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/parts/add_to_cart_block.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-amp-lite/templates/header.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-amp-lite/templates/parts/post_content.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/meta-author.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-amp-lite/templates/parts/featured_image.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: There are too many tags (15 tag instead of maximum 10)
You can look at the official readme.txt

wp-amp-lite/wp-amp.php 69% from 13 tests

The entry point to "WP AMP Lite" version 1.0.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path folder was not found ("/languages/")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-amp-lite.php" instead of "wp-amp.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0.0")

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 detected17,681 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP851,54292610,088
CSS119942946,755
JavaScript311265838

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity51.75
▷ Minimum class complexity1.00
▷ Maximum class complexity249.00
Average method complexity3.45
▷ Minimum method complexity1.00
▷ Maximum method complexity72.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes14.17%
▷ Concrete classes2395.83%
▷ Final classes00.00%
Methods499
▷ Static methods122.40%
▷ Public methods46092.18%
▷ Protected methods255.01%
▷ Private methods142.81%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants50
▷ Global constants2754.00%
▷ Class constants2346.00%
▷ Public constants23100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/ic_close_black_18dp_2x.png0.20KB0.29KB0.00%