84% rankcookie

Code Review | rankcookie

WordPress plugin rankcookie scored84%from 54 tests.

About plugin

  • Plugin page: rankcookie
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2021
  • Latest release: Oct 15, 2021
  • Number of updates: 2
  • Update frequency: every 3.5 days
  • Top authors: rankeffect (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /385 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.36ms] Passed 4 tests

A check of server-side resources used by rankcookie
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.42 ▼0.0430.67 ▼9.86
Dashboard /wp-admin3.36 ▲0.0654.18 ▲0.18
Posts /wp-admin/edit.php3.41 ▲0.0546.19 ▼12.82
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.64 ▼10.95
Media Library /wp-admin/upload.php3.28 ▲0.0534.17 ▲0.94

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for rankcookie
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,073 ▲28713.23 ▼1.072.99 ▲1.2447.89 ▲4.39
Dashboard /wp-admin2,388 ▲1854.86 ▼1.02107.28 ▼3.9043.06 ▲0.22
Posts /wp-admin/edit.php2,267 ▲1672.10 ▲0.0837.41 ▼0.2932.71 ▼5.40
Add New Post /wp-admin/post-new.php1,561 ▲3523.35 ▲5.97661.19 ▲24.8960.87 ▲11.84
Media Library /wp-admin/upload.php1,570 ▲1674.24 ▼0.11102.65 ▲0.5744.62 ▼0.85

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rankcookie/settings/rankcookie-settings.php:90
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rankcookie/templates/cookie-banner.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rankcookie/templates/gtm-snippet.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: google tag manager, gtm, cookie banner, opt-in

rankcookie/rankcookie.php Passed 13 tests

The principal PHP file in "rankcookie" v. 1.0.1 is loaded by WordPress automatically on each request
89 characters long description:
This plugin provides a light weight cookie opt-in with support for the google tag manager

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin690 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP55991255
JavaScript23345163
PO File14041141
CSS2292131

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin