83% mir-blocks-and-shortcodes

Code Review | MIR blocks and shortcodes

WordPress plugin MIR blocks and shortcodes scored 83% from 54 tests.

About plugin

  • Plugin page: mir-blocks-and-sh...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Sep 5, 2019
  • Latest release: Sep 6, 2019
  • Number of updates: 14
  • Update frequency: every 0.7 days
  • Top authors: mirsoftware (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 473 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.25MB] [CPU: ▼12.99ms] Passed 4 tests

This is a short check of server-side resources used by MIR blocks and shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.66 ▼1.07
Dashboard /wp-admin3.33 ▲0.0244.03 ▼2.11
Posts /wp-admin/edit.php3.38 ▲0.0247.81 ▼0.10
Add New Post /wp-admin/post-new.php4.82 ▼1.0753.13 ▼46.63
Media Library /wp-admin/upload.php3.25 ▲0.0232.42 ▼2.13

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 682 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
db_upgraded
mir_shortcodes_cpt
widget_recent-posts
mir_shortcodes
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
mir_shortcodes_tax

Browser metrics Passed 4 tests

This is an overview of browser requirements for MIR blocks and shortcodes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲18313.80 ▼0.4610.03 ▲8.1141.38 ▼2.25
Dashboard /wp-admin2,206 ▲154.87 ▼0.94109.44 ▲5.6541.22 ▼3.78
Posts /wp-admin/edit.php2,089 ▼02.05 ▼0.0038.82 ▼2.3734.18 ▼0.41
Add New Post /wp-admin/post-new.php6,448 ▲4,93420.49 ▲3.02802.51 ▲139.9634.06 ▼29.55
Media Library /wp-admin/upload.php1,388 ▲94.22 ▲0.0194.95 ▼2.5640.48 ▼3.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • mir_shortcodes_tax
    • can_compress_scripts
    • mir_shortcodes_cpt
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • mir_shortcodes

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
Even though everything seems fine, this is not an exhaustive test

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 items
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/mir-blocks-and-shortcodes/vendor/leafo/scssphp/src/Formatter/Compressed.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/mir-blocks-and-shortcodes/vendor/leafo/scssphp/src/Formatter/Crunched.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Leafo\\ScssPhp\\Formatter' not found in wp-content/plugins/mir-blocks-and-shortcodes/vendor/leafo/scssphp/src/Formatter/Expanded.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mir-blocks-and-shortcodes/frontend-templates/function/msc-general.php:2

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Requires php: Invalid plugin version format
The official readme.txt is a good inspiration

mir-blocks-and-shortcodes/mir-blocks-and-shortcodes.php Passed 13 tests

The main PHP script in "MIR blocks and shortcodes" version 1.0.0 is automatically included on every request by WordPress
77 characters long description:
It's a block / shortcode toolbox which makes your wordpress live much easier.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected81,667 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
CSS143,89611629,069
JavaScript585,0712,61224,718
JSON72011,351
PHP522,2313,0638,052
Sass901,5561,1156,776
HTML1311191,365
Markdown41050245
SVG70591

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 130)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity41.31
▷ Minimum class complexity1.00
▷ Maximum class complexity735.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity130.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes13.03%
Methods386
▷ Static methods164.15%
▷ Public methods11930.83%
▷ Protected methods25666.32%
▷ Private methods112.85%
Functions49
▷ Named functions3673.47%
▷ Anonymous functions1326.53%
Constants65
▷ Global constants00.00%
▷ Class constants65100.00%
▷ Public constants65100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 2.00MB with 1.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
frontend-templates/assets/img/q_top.png18.84KB0.25KB▼ 98.67%
frontend-templates/assets/img/pattern.png1,950.81KB693.86KB▼ 64.43%
frontend-templates/assets/img/q_bottom.png18.84KB0.25KB▼ 98.68%
frontend-templates/assets/img/logo.png22.79KB3.84KB▼ 83.14%
frontend-templates/assets/img/icon/ic-cal.png14.90KB0.85KB▼ 94.28%