84% monkey-treat

Code Review | Monkey Treat

WordPress plugin Monkey Treat scored84%from 54 tests.

About plugin

  • Plugin page: monkey-treat
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.8.2
  • WordPress version: 6.3.1
  • First release: Dec 8, 2021
  • Latest release: Dec 8, 2021
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: h71 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /287 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▲0.95ms] Passed 4 tests

An overview of server-side resources used by Monkey Treat
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.63 ▲6.19
Dashboard /wp-admin3.35 ▲0.0547.43 ▲0.18
Posts /wp-admin/edit.php3.46 ▲0.1147.69 ▲0.21
Add New Post /wp-admin/post-new.php5.95 ▲0.06119.60 ▲26.59
Media Library /wp-admin/upload.php3.27 ▲0.0432.85 ▼2.79
Monkey Treat /wp-admin/options-general.php?page=monkey-treat3.2432.10

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Monkey Treat
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.84 ▲0.581.74 ▼0.1438.93 ▼9.00
Dashboard /wp-admin2,210 ▲195.83 ▲0.97101.89 ▼2.5539.40 ▼4.84
Posts /wp-admin/edit.php2,090 ▲12.04 ▲0.0537.26 ▲3.4131.02 ▼4.49
Add New Post /wp-admin/post-new.php1,531 ▼623.44 ▲5.22679.26 ▲80.9751.01 ▼0.39
Media Library /wp-admin/upload.php1,392 ▲104.22 ▲0.0199.14 ▼0.2944.82 ▲3.26
Monkey Treat /wp-admin/options-general.php?page=monkey-treat8072.0223.9328.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • 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
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/monkey-treat/includes/class-monkey-treat-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Monkey_Treat\\plugin_dir_path() in wp-content/plugins/monkey-treat/constants.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/monkey-treat/includes/shortcodes.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/monkey-treat/admin/ajax.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Monkey_Treat\\plugin_dir_path() in wp-content/plugins/monkey-treat/constants.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser 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 important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (Monkey Treat settings) image required
Please take inspiration from this readme.txt

monkey-treat/monkey-treat.php Passed 13 tests

The principal PHP file in "Monkey Treat" v. 1.0.0 is loaded by WordPress automatically on each request
57 characters long description:
‌Generate link and QR image to receive Banano donation.

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
No dangerous file extensions were detected18,862 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JSON40016,762
PHP226315392,057
JavaScript22031
CSS20012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity18.95
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes20
▷ Abstract classes15.00%
▷ Concrete classes1995.00%
▷ Final classes15.26%
Methods157
▷ Static methods4830.57%
▷ Public methods15095.54%
▷ Protected methods21.27%
▷ Private methods53.18%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants31
▷ Global constants3096.77%
▷ Class constants13.23%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png20.94KB7.14KB▼ 65.88%