78% helper-for-cloudflare-web-analytics

Code Review | Helper for Cloudflare Web Analytics

WordPress plugin Helper for Cloudflare Web Analytics scored78%from 54 tests.

About plugin

  • Plugin page: helper-for-cloudf...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1
  • WordPress version: 6.3.1
  • First release: Dec 29, 2022
  • Latest release: Dec 29, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: lastsplash (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /166 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.14MB] [CPU: ▼13.72ms] Passed 4 tests

This is a short check of server-side resources used by Helper for Cloudflare Web Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.39 ▼0.0725.45 ▼15.73
Dashboard /wp-admin3.32 ▲0.0145.82 ▼2.56
Posts /wp-admin/edit.php3.37 ▲0.0143.89 ▼1.66
Add New Post /wp-admin/post-new.php5.45 ▼0.4466.42 ▼34.15
Media Library /wp-admin/upload.php3.19 ▼0.0430.01 ▼2.45
Helper for Cloudflare Web Analytics /wp-admin/options-general.php?page=cf_web_analytics3.1828.32

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Helper for Cloudflare Web Analytics
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.20 ▼1.191.98 ▲0.2243.41 ▼0.83
Dashboard /wp-admin2,212 ▲244.85 ▼0.07110.52 ▲7.1042.44 ▼0.81
Posts /wp-admin/edit.php2,095 ▲62.01 ▼0.0434.35 ▼3.4132.57 ▼0.05
Add New Post /wp-admin/post-new.php1,533 ▲523.16 ▲5.06665.23 ▲12.9252.38 ▼5.52
Media Library /wp-admin/upload.php1,394 ▲94.19 ▼0.0694.64 ▼12.6342.79 ▼1.14
Helper for Cloudflare Web Analytics /wp-admin/options-general.php?page=cf_web_analytics8592.0623.7326.04

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cf_web_analytics
    • > Notice in wp-content/plugins/helper-for-cloudflare-web-analytics/includes/settings.php+190
    Trying to access array offset on value of type null

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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/helper-for-cloudflare-web-analytics/includes/load-script.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/helper-for-cloudflare-web-analytics/includes/settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/helper-for-cloudflare-web-analytics/includes/settings.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
5 plugin tags: privacy, stats, analytics, cloudflare, statistics

helper-for-cloudflare-web-analytics/plugin.php 77% from 13 tests

"Helper for Cloudflare Web Analytics" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time 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
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("helper-for-cloudflare-web-analytics.php" instead of "plugin.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "5.3")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected168 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP357104133
CSS17035

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.22
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%
Functions10
▷ Named functions10100.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
There were not PNG files found in your plugin