90% analytics-for-cloudflare

Code Review | Analytics for Cloudflare

WordPress plugin Analytics for Cloudflare scored90%from 54 tests.

About plugin

  • Plugin page: analytics-for-clo...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.3
  • WordPress version: 6.3.1
  • First release: Nov 10, 2015
  • Latest release: Feb 9, 2017
  • Number of updates: 11
  • Update frequency: every 41.6 days
  • Top authors: chuckmac (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30+ active /2,403 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
Install script ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.58ms] Passed 4 tests

A check of server-side resources used by Analytics for Cloudflare
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.33 ▼0.73
Dashboard /wp-admin3.44 ▲0.1453.07 ▼0.37
Posts /wp-admin/edit.php3.53 ▲0.1851.35 ▲0.45
Add New Post /wp-admin/post-new.php6.00 ▲0.1294.91 ▼17.67
Media Library /wp-admin/upload.php3.34 ▲0.1238.74 ▲0.47
Analytics For CloudFlare /wp-admin/options-general.php?page=cmd_analytics_for_cloudflare3.3335.28

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Analytics for Cloudflare
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,864 ▲10313.46 ▼0.781.78 ▲0.1141.96 ▼0.53
Dashboard /wp-admin2,267 ▲645.18 ▲0.25105.22 ▼0.4740.37 ▼5.54
Posts /wp-admin/edit.php2,107 ▲102.00 ▼0.0439.42 ▲3.1435.34 ▲2.35
Add New Post /wp-admin/post-new.php1,562 ▲3118.07 ▼5.09664.04 ▼51.0268.05 ▲16.17
Media Library /wp-admin/upload.php1,401 ▲14.22 ▼0.01103.76 ▼2.5846.20 ▼3.35
Analytics For CloudFlare /wp-admin/options-general.php?page=cmd_analytics_for_cloudflare8112.0423.3625.98

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: analytics, dashboard, admin

analytics-for-cloudflare/analytics-for-cloudflare.php 92% from 13 tests

The entry point to "Analytics for Cloudflare" version 1.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin5,838 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,1066685,014
PHP8211348633
Markdown5480106
CSS117085

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.20
▷ Minimum class complexity1.00
▷ Maximum class complexity24.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods62
▷ Static methods46.45%
▷ Public methods6096.77%
▷ Protected methods00.00%
▷ Private methods23.23%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin