84% limit-parameter-for-gallery-shortcode

Code Review | Limit parameter for gallery shortcode

WordPress plugin Limit parameter for gallery shortcode scored84%from 54 tests.

About plugin

  • Plugin page: limit-parameter-f...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Sep 21, 2014
  • Latest release: Dec 8, 2016
  • Number of updates: 6
  • Update frequency: every 135.0 days
  • Top authors: nboehr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,241 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.01MB] [CPU: ▼6.54ms] Passed 4 tests

Analyzing server-side resources used by Limit parameter for gallery shortcode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.92 ▼4.05
Dashboard /wp-admin3.31 ▲0.0146.84 ▼3.28
Posts /wp-admin/edit.php3.36 ▲0.0143.59 ▼9.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.36 ▼9.06
Media Library /wp-admin/upload.php3.23 ▲0.0137.42 ▲1.53

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Limit parameter for gallery shortcode
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.74 ▲0.391.77 ▲0.0245.79 ▲2.16
Dashboard /wp-admin2,192 ▲185.64 ▲0.0687.24 ▼0.8138.42 ▼4.67
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0335.58 ▼4.7432.80 ▲0.84
Add New Post /wp-admin/post-new.php1,526 ▼223.50 ▲0.38609.03 ▼21.3968.81 ▲16.08
Media Library /wp-admin/upload.php1,403 ▼04.19 ▼0.00100.97 ▼5.2242.65 ▼1.20

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/limit-parameter-for-gallery-shortcode/gallery-limit.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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
4 plugin tags: images, shortcode, limit, gallery

limit-parameter-for-gallery-shortcode/gallery-limit.php 92% from 13 tests

The entry point to "Limit parameter for gallery shortcode" version 2.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("limit-parameter-for-gallery-shortcode.php" instead of "gallery-limit.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
Success! There were no dangerous files found in this plugin39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1131239

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin