84% cookie-tasting

Code Review | Cookie Tasting

WordPress plugin Cookie Tasting scored84%from 54 tests.

About plugin

  • Plugin page: cookie-tasting
  • Plugin version: 1.0.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.5
  • WordPress version: 6.3.1
  • First release: Mar 14, 2019
  • Latest release: Oct 27, 2020
  • Number of updates: 28
  • Update frequency: every 21.2 days
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,403 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.81ms] Passed 4 tests

Server-side resources used by Cookie Tasting
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1444.38 ▼0.21
Dashboard /wp-admin3.42 ▲0.0858.08 ▼2.87
Posts /wp-admin/edit.php3.54 ▲0.1849.20 ▼10.88
Add New Post /wp-admin/post-new.php6.01 ▲0.1289.89 ▼17.29
Media Library /wp-admin/upload.php3.35 ▲0.1238.25 ▲1.17

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 95 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
cookie_tasting_rewrite_version
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Cookie Tasting: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲18513.72 ▼0.6430.61 ▲28.7941.62 ▼4.56
Dashboard /wp-admin2,198 ▲245.61 ▼0.0791.55 ▼7.9140.63 ▼4.94
Posts /wp-admin/edit.php2,100 ▼32.05 ▲0.0139.96 ▼3.7738.93 ▲1.58
Add New Post /wp-admin/post-new.php1,526 ▼017.48 ▼0.06689.70 ▲4.8452.60 ▼1.59
Media Library /wp-admin/upload.php1,403 ▲34.22 ▼0.04101.92 ▼3.8043.69 ▼2.19

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 33× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Provider\\TimeProviderInterface' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Provider/Time/FixedTimeProvider.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Codec\\StringCodec' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Codec/OrderedTimeCodec.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\TimeGeneratorInterface' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Generator/PeclUuidTimeGenerator.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Generator/SodiumRandomGenerator.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookie-tasting/includes/js-helper.php:11
    • > PHP Fatal error
      Uncaught UnexpectedValueException: creating archive "wp-content/plugins/cookie-tasting/vendor/paragonie/random_compat/dist/random_compat.phar" disabled by the php.ini setting phar.readonly in /var/www/wordpress/wp-content/plugins/cookie-tasting/vendor/paragonie/random_compat/other/build_phar.php:12
    • > PHP Fatal error
      require_once(): Failed opening required 'lib/byte_safe_strings.php' (include_path='.:/usr/share/php') in wp-content/plugins/cookie-tasting/vendor/paragonie/random_compat/psalm-autoload.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\Generator\\RandomGeneratorInterface' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Generator/PeclUuidRandomGenerator.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Ramsey\\Uuid\\UuidFactoryInterface' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/UuidFactory.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Ramsey\\Uuid\\Codec\\StringCodec' not found in wp-content/plugins/cookie-tasting/vendor/ramsey/uuid/src/Codec/GuidStringCodec.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: membership, cookie, cache

cookie-tasting/cookie-tasting.php 85% from 13 tests

The main PHP file in "Cookie Tasting" ver. 1.0.11 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin3,706 lines of code in 83 files:
LanguageFilesBlank linesComment linesLines of code
PHP677042,7692,468
Markdown33060552
JSON600457
JavaScript541104207
XML10019
Bourne Shell1203

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity3.98
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces14
Interfaces10
Traits0
Classes41
▷ Abstract classes00.00%
▷ Concrete classes41100.00%
▷ Final classes12.44%
Methods240
▷ Static methods3815.83%
▷ Public methods21890.83%
▷ Protected methods197.92%
▷ Private methods31.25%
Functions45
▷ Named functions3475.56%
▷ Anonymous functions1124.44%
Constants16
▷ Global constants00.00%
▷ Class constants16100.00%
▷ Public constants16100.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