78% multiple-gallery-on-post

Code Review | Multiple Gallery on Post

WordPress plugin Multiple Gallery on Post scored78%from 54 tests.

About plugin

  • Plugin page: multiple-gallery-...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.0-3.8
  • WordPress version: 6.3.1
  • First release: Nov 14, 2013
  • Latest release: Dec 24, 2013
  • Number of updates: 12
  • Update frequency: every 3.3 days
  • Top authors: wirka (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /4,954 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.61MB] [CPU: ▼13.93ms] Passed 4 tests

Analyzing server-side resources used by Multiple Gallery on Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0642.27 ▼5.68
Dashboard /wp-admin3.38 ▲0.0745.78 ▼2.31
Posts /wp-admin/edit.php3.43 ▲0.0748.31 ▲3.60
Add New Post /wp-admin/post-new.php3.22 ▼2.6638.15 ▼49.82
Media Library /wp-admin/upload.php3.30 ▲0.0736.62 ▲2.10
Multiple Gallery on Post /wp-admin/options-general.php?page=mgop_setting_menu_id3.2430.23

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Multiple Gallery on Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.68 ▼0.691.65 ▼0.4646.48 ▼4.67
Dashboard /wp-admin2,214 ▲234.87 ▼1.01109.32 ▼4.7938.26 ▼4.07
Posts /wp-admin/edit.php2,101 ▲152.25 ▲0.2440.58 ▲4.4135.76 ▲0.13
Add New Post /wp-admin/post-new.php1,521 ▼1223.24 ▼0.04656.79 ▼20.7859.86 ▲3.21
Media Library /wp-admin/upload.php1,396 ▲114.25 ▲0.03109.60 ▲8.1544.92 ▲0.76
Multiple Gallery on Post /wp-admin/options-general.php?page=mgop_setting_menu_id9471.9529.5926.08

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=mgop_setting_menu_id
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=mgop_setting_menu_id
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mgop_setting_menu_id
    • > Notice in wp-content/plugins/multiple-gallery-on-post/admin/options.php+78
    Trying to access array offset on value of type bool
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mgop_setting_menu_id
    • > Notice in wp-content/plugins/multiple-gallery-on-post/admin/options.php+78
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=mgop_setting_menu_id
    • > Warning in wp-content/plugins/multiple-gallery-on-post/admin/options.php+78
    count(): Parameter must be an array or an object that implements Countable

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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/multiple-gallery-on-post/admin/metabox.php:95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/multiple-gallery-on-post/functions.php:187
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/multiple-gallery-on-post/multiple-gallery-on-post.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/multiple-gallery-on-post/admin/options.php:10

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Settings page), #2 (Add images to gallery through edit post page), #3 (The galleries preview on post)
The official readme.txt might help

multiple-gallery-on-post/multiple-gallery-on-post.php 92% from 13 tests

Analyzing the main PHP file in "Multiple Gallery on Post" version 0.4
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin392 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP45334203
CSS2262153
JavaScript124336

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/uploader-icons.png1.56KB2.04KB0.00%
admin/images/mgop-logo.png8.73KB4.66KB▼ 46.69%
admin/images/draggable.png3.62KB0.25KB▼ 93.04%
admin/images/welcome-icons.png2.10KB2.08KB▼ 1.21%