100% amp-related-posts

Code Review | AMP Related Posts

WordPress plugin AMP Related Posts scored 100% from 54 tests.

About plugin

  • Plugin page: amp-related-posts
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.7
  • WordPress version: 5.9.2
  • First release: Jul 4, 2016
  • Latest release: Dec 20, 2016
  • Number of updates: 35
  • Update frequency: every 4.8 days
  • Top authors: nmvdvjr (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

70+ active / 3,100 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼303.19ms] Passed 4 tests

This is a short check of server-side resources used by AMP Related Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0164.62 ▼21.33
Dashboard /wp-admin3.42 ▲0.0233.84 ▼0.26
Posts /wp-admin/edit.php3.66 ▲0.0239.33 ▼7.81
Add New Post /wp-admin/post-new.php6.89 ▼0.08101.04 ▼1,181.47
Media Library /wp-admin/upload.php3.31 ▲0.0125.49 ▼2.13

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

AMP Related Posts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,782 ▲6015.81 ▲0.545.91 ▲0.052.11 ▼0.63
Dashboard /wp-admin2,911 ▲575.99 ▼0.14117.97 ▼9.49239.39 ▲60.98
Posts /wp-admin/edit.php2,711 ▲203.10 ▼0.1462.89 ▼23.95146.34 ▼1.89
Add New Post /wp-admin/post-new.php1,674 ▼4520.88 ▼1.12444.74 ▲31.78258.71 ▲85.75
Media Library /wp-admin/upload.php1,712 ▲175.56 ▲0.06138.31 ▼17.32243.82 ▼5.04

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests Passed 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 Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
2 plugin tags: amp, related posts

amp-related-posts/AMP Related Posts.php 92% from 13 tests

The principal PHP file in "AMP Related Posts" v. 2.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("amp-related-posts.php" instead of "AMP Related Posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected381 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP159933381

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.39KB1.22KB▼ 12.17%