79% amp-post-script

Code Review | AMP Post Script

WordPress plugin AMP Post Script scored 79% from 54 tests.

About plugin

  • Plugin page: amp-post-script
  • Plugin version: 1.7.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2016
  • Latest release: May 5, 2022
  • Number of updates: 26
  • Update frequency: every 77.2 days
  • Top authors: SilverOkami42 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,885 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼3.14ms] Passed 4 tests

This is a short check of server-side resources used by AMP Post Script
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0139.03 ▼2.14
Dashboard /wp-admin3.31 ▲0.0049.85 ▼3.66
Posts /wp-admin/edit.php3.36 ▲0.0049.45 ▼1.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0098.06 ▼5.69
Media Library /wp-admin/upload.php3.23 ▲0.0034.52 ▲1.43

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by AMP Post Script
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.174.78 ▲2.4044.32 ▼0.67
Dashboard /wp-admin2,206 ▲184.84 ▼0.06106.97 ▼9.5439.79 ▼7.06
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0240.07 ▲2.2436.82 ▲1.13
Add New Post /wp-admin/post-new.php1,547 ▲518.30 ▲0.19601.11 ▼42.2275.09 ▲6.81
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.0693.26 ▼4.6441.84 ▼2.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/amp-post-script/amp-post-script.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'AMP_Post_Template' not found in wp-content/plugins/amp-post-script/includes/custom-styles.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_title() in wp-content/plugins/amp-post-script/includes/ps-header.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_type() in wp-content/plugins/amp-post-script/includes/ps-header-bar.php:1

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: custom, post script, amp

amp-post-script/amp-post-script.php Passed 13 tests

The principal PHP file in "AMP Post Script" v. 1.7.5 is loaded by WordPress automatically on each request
35 characters long description:
Modify the AMP plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected361 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP567127361

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity63.00
▷ Minimum class complexity63.00
▷ Maximum class complexity63.00
Average method complexity4.59
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods1266.67%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected