79% cmwp-analytics

Code Review | CMWP-Analytics

WordPress plugin CMWP-Analytics scored79%from 54 tests.

About plugin

  • Plugin page: cmwp-analytics
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.3
  • WordPress version: 6.3.1
  • First release: Jul 11, 2017
  • Latest release: Nov 16, 2017
  • Number of updates: 24
  • Update frequency: every 5.3 days
  • Top authors: peter.sentner (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /1,729 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼13.86ms] Passed 4 tests

This is a short check of server-side resources used by CMWP-Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0539.55 ▲3.82
Dashboard /wp-admin3.37 ▲0.0344.39 ▼20.35
Posts /wp-admin/edit.php3.48 ▲0.1344.55 ▼6.11
Add New Post /wp-admin/post-new.php5.95 ▲0.0781.47 ▼28.54
Media Library /wp-admin/upload.php3.29 ▲0.0733.17 ▼0.43
CMWP Analytics /wp-admin/options-general.php?page=cmwp-analytics3.2631.59

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

CMWP-Analytics: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.31 ▼1.274.52 ▲2.8943.61 ▲2.36
Dashboard /wp-admin2,213 ▲254.86 ▼0.04105.27 ▼0.8837.48 ▼5.76
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0334.66 ▼5.6732.53 ▼3.51
Add New Post /wp-admin/post-new.php1,520 ▼217.82 ▼5.27602.84 ▼39.8151.88 ▼14.34
Media Library /wp-admin/upload.php1,392 ▲44.20 ▲0.0095.13 ▼1.1041.90 ▼1.52
CMWP Analytics /wp-admin/options-general.php?page=cmwp-analytics8762.0528.7728.70

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 does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 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 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cmwp-analytics/templates/tracking-snippet/google-analytics-universal.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: gaoptout in wp-content/plugins/cmwp-analytics/templates/tracking-snippet/google-analytics-universal.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cmwp-analytics/templates/admin/options-page.php:2
    • > PHP Notice
      Undefined variable: anonymizeip in wp-content/plugins/cmwp-analytics/templates/tracking-snippet/google-analytics-universal.php on line 25
    • > PHP Notice
      Undefined variable: linker in wp-content/plugins/cmwp-analytics/templates/tracking-snippet/google-analytics-universal.php on line 28
    • > PHP Notice
      Undefined variable: tracking_id in wp-content/plugins/cmwp-analytics/templates/tracking-snippet/google-analytics-universal.php on line 24

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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
7 plugin tags: analytics, cross-domain, tracking, linker, autolink...

cmwp-analytics/cmwp-analytics.php Passed 13 tests

The principal PHP file in "CMWP-Analytics" v. 0.4 is loaded by WordPress automatically on each request
39 characters long description:
Google Analytics Univsersal integration

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected357 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP586169357

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.35
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods34
▷ Static methods12.94%
▷ Public methods2985.29%
▷ Protected methods00.00%
▷ Private methods514.71%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
No PNG files were detected