84% amr-shortcodes

Code Review | amr shortcodes

WordPress plugin amr shortcodes scored84%from 54 tests.

About plugin

  • Plugin page: amr-shortcodes
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.1
  • WordPress version: 6.3.1
  • First release: May 24, 2017
  • Latest release: May 9, 2021
  • Number of updates: 28
  • Update frequency: every 51.6 days
  • Top authors: anmari (100%)Otto42 (7.14%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,869 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.66ms] Passed 4 tests

An overview of server-side resources used by amr shortcodes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0537.82 ▼2.44
Dashboard /wp-admin3.35 ▲0.0544.65 ▼8.11
Posts /wp-admin/edit.php3.40 ▲0.0546.86 ▼1.17
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.83 ▼6.93
Media Library /wp-admin/upload.php3.28 ▲0.0533.54 ▼0.03
Shortcodes /wp-admin/tools.php?page=amr_shortcodes3.2429.85

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

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

Browser metrics Passed 4 tests

Checking browser requirements for amr shortcodes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.19 ▼1.001.87 ▲0.1539.12 ▼2.66
Dashboard /wp-admin2,207 ▲165.79 ▲0.89102.64 ▼5.8239.81 ▼0.87
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0439.78 ▲3.1236.10 ▼6.20
Add New Post /wp-admin/post-new.php1,538 ▲523.09 ▼0.05686.90 ▲1.6558.29 ▼1.23
Media Library /wp-admin/upload.php1,392 ▲104.18 ▼0.0196.69 ▼1.3643.28 ▲1.05
Shortcodes /wp-admin/tools.php?page=amr_shortcodes8712.0222.7325.21

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/amr-shortcodes/amr_shortcodes.php:278

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Donate link: Invalid URI ("paypal to anmari@anmari.com")
Please take inspiration from this readme.txt

amr-shortcodes/amr_shortcodes.php 92% from 13 tests

The entry point to "amr shortcodes" version 1.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("amr-shortcodes.php" instead of "amr_shortcodes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected228 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP15914228

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity4.89
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.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
PNG images were not found in this plugin