10% miaoroom-toolbox

Code Review | Miaoroom ToolBox

WordPress plugin Miaoroom ToolBox scored10%from 54 tests.

About plugin

  • Plugin page: miaoroom-toolbox
  • Plugin version: 1.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 5, 2020
  • Latest release: Jun 5, 2020
  • Number of updates: 35
  • Update frequency: every 0.0 days
  • Top authors: miaoroom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,166 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/miaoroom-toolbox/src/core/core.php+60
    date_default_timezone_set(): Timezone ID '' is invalid

Server metrics [RAM: ▼1.12MB] [CPU: ▼49.49ms] Passed 4 tests

Server-side resources used by Miaoroom ToolBox
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▼0.5812.98 ▼27.35
Dashboard /wp-admin2.90 ▼0.4517.85 ▼44.04
Posts /wp-admin/edit.php2.90 ▼0.4615.65 ▼32.88
Add New Post /wp-admin/post-new.php2.90 ▼2.9915.11 ▼93.67
Media Library /wp-admin/upload.php2.90 ▼0.3320.92 ▼16.67

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

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

Browser metrics Passed 4 tests

Miaoroom ToolBox: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,070 ▲30915.05 ▲0.782.13 ▲0.2743.37 ▲0.72
Dashboard /wp-admin2,442 ▲2656.70 ▲1.11126.47 ▲36.0648.40 ▲4.49
Posts /wp-admin/edit.php2,372 ▲2753.81 ▲1.8453.03 ▲12.1339.47 ▲0.90
Add New Post /wp-admin/post-new.php1,619 ▲8723.46 ▲0.27700.55 ▲39.1341.88 ▼26.24
Media Library /wp-admin/upload.php1,506 ▲1064.75 ▲0.5097.10 ▼18.9053.33 ▲3.15
喵容聚合图床设置 /wp-admin/admin.php?page=miaoroom-toolbox-settings#tab=11,5053.7166.61130.00
优化设置 /wp-admin/admin.php?page=miaoroom-toolbox-settings#tab=21,4953.5848.4752.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/miaoroom-toolbox/src/core/core.php+60
    date_default_timezone_set(): Timezone ID '' is invalid
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • MRTB
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Almost there! Just fix the following items
  • 125× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/guzzle/tests/InternalUtilsTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/psr7/tests/ResponseTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Tests\\Psr7\\BaseTest' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/guzzle/tests/HandlerStackTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php:11
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, string given in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/guzzle/build/Burgomaster.php on line 115
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/miaoroom-toolbox/vendor/guzzlehttp/psr7/src/UploadedFile.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: miaoroom, cdn, wordpress

miaoroom-toolbox/miaoroom-toolbox.php 77% from 13 tests

The entry point to "Miaoroom ToolBox" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 177 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Git Repository: A Git repository was detected inside this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin43,811 lines of code in 307 files:
LanguageFilesBlank linesComment linesLines of code
PHP2575,7077,06830,443
JavaScript51,2434004,063
CSS42834663,967
Markdown868902,816
reStructuredText88591,0811,133
JSON900815
make4475202
PO File27179174
YAML3191101
XML30057
Python1182228
Dockerfile18010
SVG2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces26
Interfaces15
Traits2
Classes203
▷ Abstract classes41.97%
▷ Concrete classes19998.03%
▷ Final classes168.04%
Methods1,905
▷ Static methods1879.82%
▷ Public methods1,73491.02%
▷ Protected methods301.57%
▷ Private methods1417.40%
Functions591
▷ Named functions15826.73%
▷ Anonymous functions43373.27%
Constants110
▷ Global constants4944.55%
▷ Class constants6155.45%
▷ Public constants61100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 1.25MB with 0.52MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png382.84KB116.37KB▼ 69.60%
vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
admin/CSF/assets/images/checkerboard.png2.29KB2.54KB0.00%
screenshot-3.png537.99KB168.44KB▼ 68.69%
vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%