84% mrcookies

Code Review | Mr Cookies

WordPress plugin Mr Cookies scored84%from 54 tests.

About plugin

  • Plugin page: mrcookies
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 11, 2014
  • Latest release: Jun 8, 2015
  • Number of updates: 15
  • Update frequency: every 28.2 days
  • Top authors: articstudio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /2,517 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.02MB] [CPU: ▼2.37ms] Passed 4 tests

Server-side resources used by Mr Cookies
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0434.58 ▼5.42
Dashboard /wp-admin3.33 ▲0.0243.53 ▲0.31
Posts /wp-admin/edit.php3.38 ▲0.0245.36 ▼5.75
Add New Post /wp-admin/post-new.php5.91 ▲0.02118.58 ▲18.22
Media Library /wp-admin/upload.php3.25 ▲0.0236.36 ▲1.39
Mr Cookies /wp-admin/options-general.php?page=mr-cookies3.3229.75

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 19 new options
New WordPress options
mrcookies_style_custom_css
mrcookies_style_background_color
widget_theysaidso_widget
mrcookies_installed
mrcookies_style_text_color
can_compress_scripts
mrcookies_style_type
widget_recent-comments
db_upgraded
mrcookies_legal_notice_type
...

Browser metrics Passed 4 tests

Checking browser requirements for Mr Cookies
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.41 ▼0.983.47 ▲1.7136.99 ▼7.01
Dashboard /wp-admin2,229 ▲385.14 ▲0.21114.48 ▲16.8741.50 ▲3.02
Posts /wp-admin/edit.php2,096 ▲72.34 ▲0.3536.98 ▼2.7329.43 ▼7.38
Add New Post /wp-admin/post-new.php1,535 ▲223.38 ▲0.15623.65 ▼30.2633.81 ▼28.19
Media Library /wp-admin/upload.php1,412 ▲244.41 ▲0.2392.68 ▼15.6943.67 ▼4.88
Mr Cookies /wp-admin/options-general.php?page=mr-cookies1,4382.6765.3530.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mrcookies/include/backend.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mrcookies/include/frontend.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mrcookies_text() in wp-content/plugins/mrcookies/admin/options-page.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mrcookies/mr-cookies.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mrcookies === )
You can look at the official readme.txt

mrcookies/mr-cookies.php 92% from 13 tests

The main file in "Mr Cookies" v. 1.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mrcookies.php" instead of "mr-cookies.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected695 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP56174405
JavaScript32337167
PO File391275
CSS20048

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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
img/close.png0.24KB0.20KB▼ 17.41%