90% amp-img-shortcode

Code Review | AMP Img Shortcode

WordPress plugin AMP Img Shortcode scored 90% from 54 tests.

About plugin

  • Plugin page: amp-img-shortcode
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jul 7, 2018
  • Latest release: Jan 21, 2020
  • Number of updates: 4
  • Update frequency: every 140.8 days
  • Top authors: wpza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,181 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

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

A check of server-side resources used by AMP Img Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0034.56 ▼9.70
Dashboard /wp-admin3.31 ▲0.0047.38 ▼11.11
Posts /wp-admin/edit.php3.36 ▲0.0049.24 ▲2.02
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.73 ▼17.72
Media Library /wp-admin/upload.php3.23 ▲0.0034.50 ▲1.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for AMP Img Shortcode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.44 ▲0.061.66 ▼0.1540.17 ▼9.38
Dashboard /wp-admin2,209 ▲215.91 ▲0.01103.92 ▼4.3839.53 ▼1.58
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0340.00 ▲0.4436.47 ▲1.00
Add New Post /wp-admin/post-new.php1,542 ▼022.94 ▲4.48667.42 ▲71.7754.78 ▲5.80
Media Library /wp-admin/upload.php1,391 ▲34.25 ▲0.0195.43 ▲0.1041.04 ▼1.10

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: amp-img, accelerated mobile pages, amp-image, ampify

amp-img-shortcode/wpza_ais.php 92% from 13 tests

Analyzing the main PHP file in "AMP Img Shortcode" version 1.0.1
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("amp-img-shortcode.php" instead of "wpza_ais.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin48 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP352248

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.65
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods3
▷ Static methods00.00%
▷ Public methods133.33%
▷ Protected methods00.00%
▷ Private methods266.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin