62% multiple-and-single-gallery

Code Review | Multiple And Single Gallery

WordPress plugin Multiple And Single Gallery scored62%from 54 tests.

About plugin

  • Plugin page: multiple-and-sing...
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2018
  • Latest release: Sep 2, 2019
  • Number of updates: 13
  • Update frequency: every 41.2 days
  • Top authors: webgensis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /586 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.19MB] [CPU: ▼42.99ms] Passed 4 tests

An overview of server-side resources used by Multiple And Single Gallery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.79 ▼0.6814.42 ▼28.54
Dashboard /wp-admin2.82 ▼0.4819.26 ▼32.99
Posts /wp-admin/edit.php2.83 ▼0.5317.77 ▼34.11
Add New Post /wp-admin/post-new.php2.82 ▼3.0617.39 ▼76.32
Media Library /wp-admin/upload.php2.83 ▼0.4015.32 ▼22.67
Gallery /wp-admin/edit.php?post_type=gallery2.8316.27
Add New /wp-admin/post-new.php?post_type=gallery2.8315.66
Categories /wp-admin/edit-tags.php?taxonomy=Cgallery&post_type=gallery2.8316.76
Gallery Settings /wp-admin/options-general.php?page=gallery_settings2.8317.48

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
simple_and_3d_condition
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Multiple And Single Gallery
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,878 ▲11714.32 ▼0.345.73 ▲4.1145.31 ▼3.18
Dashboard /wp-admin2,239 ▲595.65 ▼0.0285.38 ▼6.2339.66 ▼3.72
Posts /wp-admin/edit.php2,141 ▲382.02 ▼0.0641.46 ▲1.8936.34 ▲0.76
Add New Post /wp-admin/post-new.php1,574 ▲4323.42 ▲0.28650.70 ▼51.6760.94 ▲5.07
Media Library /wp-admin/upload.php1,438 ▲414.20 ▲0.01100.78 ▼15.9446.58 ▼2.76
Gallery /wp-admin/edit.php?post_type=gallery1,1221.9632.7031.05
Add New /wp-admin/post-new.php?post_type=gallery2,3407.73190.7369.37
Categories /wp-admin/edit-tags.php?taxonomy=Cgallery&post_type=gallery1,3122.1429.6030.66
Gallery Settings /wp-admin/options-general.php?page=gallery_settings8382.1926.1029.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/multiple-and-single-gallery/index.php+30
    Undefined variable: labels
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • simple_and_3d_condition
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gallery_settings
    • > Notice in wp-content/plugins/multiple-and-single-gallery/index.php+30
    Undefined variable: labels
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gallery_settings
    • > Warning in wp-content/plugins/multiple-and-single-gallery/index.php+249
    Use of undefined constant gallery_settings - assumed 'gallery_settings' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/multiple-and-single-gallery/index.php:38

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gallery_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/multiple-and-single-gallery/js/admin_script.js?ver=6.3.1:3:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gallery_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function
    • > GET request to /wp-admin/post-new.php?post_type=gallery
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/multiple-and-single-gallery/js/admin_script.js?ver=6.3.1:3:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=gallery
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: display multiple and single gallery whith shortcode

multiple-and-single-gallery/index.php 85% from 13 tests

"Multiple And Single Gallery" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("multiple-and-single-gallery.php" instead of "index.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
Success! There were no dangerous files found in this plugin7,731 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS729174,665
SVG1002,671
PHP11519248
JavaScript53427147

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/next.png1.32KB1.58KB0.00%
images/prev.png1.33KB1.59KB0.00%
images/close.png0.27KB0.29KB0.00%