84% mtphr-galleries

Code Review | Metaphor Galleries

WordPress plugin Metaphor Galleries scored84%from 54 tests.

About plugin

  • Plugin page: mtphr-galleries
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-5.5.1
  • WordPress version: 6.3.1
  • First release: Mar 27, 2013
  • Latest release: Sep 29, 2020
  • Number of updates: 88
  • Update frequency: every 31.4 days
  • Top authors: metaphorcreations (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /14,594 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.58MB] [CPU: ▼3.77ms] Passed 4 tests

An overview of server-side resources used by Metaphor Galleries
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4640.52 ▼3.06
Dashboard /wp-admin4.00 ▲0.6751.92 ▲5.04
Posts /wp-admin/edit.php4.06 ▲0.6753.92 ▲10.20
Add New Post /wp-admin/post-new.php6.52 ▲0.6086.26 ▼19.03
Media Library /wp-admin/upload.php3.86 ▲0.6038.66 ▲1.99
Add New /wp-admin/post-new.php?post_type=mtphr_gallery4.0855.98
Tags /wp-admin/edit-tags.php?taxonomy=mtphr_gallery_tag&post_type=mtphr_gallery3.8648.59
Categories /wp-admin/edit-tags.php?taxonomy=mtphr_gallery_category&post_type=mtphr_gallery3.8638.14
Settings /wp-admin/edit.php?post_type=mtphr_gallery&page=mtphr_galleries_settings_menu3.8640.58
Galleries /wp-admin/edit.php?post_type=mtphr_gallery4.0045.62

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: no files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_mtphr-gallery-categories
widget_recent-posts
mtphr_galleries_settings
widget_mtphr-gallery-data
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Metaphor Galleries
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,037 ▲26613.89 ▼0.7012.04 ▲10.1637.10 ▼5.53
Dashboard /wp-admin2,248 ▲635.88 ▲0.03106.39 ▼7.9037.15 ▼9.79
Posts /wp-admin/edit.php2,131 ▲422.01 ▼0.0443.70 ▲9.6637.42 ▲5.86
Add New Post /wp-admin/post-new.php1,565 ▲2123.02 ▲4.74679.62 ▲27.2355.56 ▲0.08
Media Library /wp-admin/upload.php1,427 ▲454.21 ▲0.0491.37 ▼6.7244.36 ▲2.34
Add New /wp-admin/post-new.php?post_type=mtphr_gallery3,0387.59202.1176.78
Tags /wp-admin/edit-tags.php?taxonomy=mtphr_gallery_tag&post_type=mtphr_gallery1,2702.1425.1827.15
Categories /wp-admin/edit-tags.php?taxonomy=mtphr_gallery_category&post_type=mtphr_gallery1,3012.2629.4629.68
Settings /wp-admin/edit.php?post_type=mtphr_gallery&page=mtphr_galleries_settings_menu1,3413.4939.9652.95
Galleries /wp-admin/edit.php?post_type=mtphr_gallery1,3283.5344.7334.17

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • db_upgraded
    • widget_mtphr-gallery-categories
    • widget_theysaidso_widget
    • can_compress_scripts
    • mtphr_galleries_settings
    • widget_mtphr-gallery-data
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 items
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mtphr-galleries/includes/admin/generators/gallery.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mtphr-galleries/includes/post-types.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mtphr-galleries/mtphr-galleries.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mtphr-galleries/includes/scripts.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mtphr-galleries/includes/settings.php:187
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mtphr-galleries/includes/ajax.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_post_type_support() in wp-content/plugins/mtphr-galleries/includes/functions.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mtphr-galleries/includes/filters.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mtphr-galleries/includes/admin/edit-columns.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mtphr-galleries/includes/widget-categories.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Coming soon.) image required
You can take inspiration from this readme.txt

mtphr-galleries/mtphr-galleries.php 92% from 13 tests

"Metaphor Galleries" version 2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 146 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
Success! There were no dangerous files found in this plugin5,412 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP208454932,635
JavaScript93923561,125
PO File2339748748
CSS34864740
HTML140137
SVG11018
XML1209

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions100
▷ Named functions100100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons.png1.69KB0.53KB▼ 68.42%