10% cp-analytics-pro

Code Review | CP Analytics pro

WordPress plugin CP Analytics pro scored10%from 54 tests.

About plugin

  • Plugin page: cp-analytics-pro
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-4.4.2
  • WordPress version: 6.3.1
  • First release: May 4, 2016
  • Latest release: May 4, 2016
  • Number of updates: 16
  • Update frequency: every 0.1 days
  • Top authors: creativepig (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,179 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cp-analytics-pro/google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.74MB] [CPU: ▼55.19ms] Passed 4 tests

Analyzing server-side resources used by CP Analytics pro
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.24 ▼1.228.37 ▼39.06
Dashboard /wp-admin2.26 ▼1.049.07 ▼41.04
Posts /wp-admin/edit.php2.27 ▼1.0910.09 ▼42.71
Add New Post /wp-admin/post-new.php2.26 ▼3.628.95 ▼97.95
Media Library /wp-admin/upload.php2.26 ▼0.969.46 ▼26.08
Setting /wp-admin/admin.php?page=gap_settings2.278.09
Dashboard /wp-admin/admin.php?page=gap_dashboard2.2711.74

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 302 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

CP Analytics pro: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,855 ▲9413.85 ▼0.531.74 ▼0.0238.79 ▼7.54
Dashboard /wp-admin2,259 ▲795.50 ▼0.14100.33 ▲11.1763.88 ▲24.70
Posts /wp-admin/edit.php2,179 ▲792.56 ▲0.5248.67 ▲7.2254.20 ▲16.77
Add New Post /wp-admin/post-new.php1,591 ▲6524.10 ▲1.24662.26 ▼54.9637.68 ▼20.64
Media Library /wp-admin/upload.php1,476 ▲765.02 ▲0.82106.26 ▼10.5455.43 ▲5.65
Setting /wp-admin/admin.php?page=gap_settings9102.4630.9136.43
Dashboard /wp-admin/admin.php?page=gap_dashboard2,1402.7646.2240.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/cp-analytics-pro/google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gap_dashboard
    • > Deprecated in wp-content/plugins/cp-analytics-pro/google/Utils.php+67
    Array and string offset access syntax with curly braces is deprecated

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 take a closer look at the following
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cp-analytics-pro/classes/template/browser.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/keywords.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/city.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/country.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/realtime.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/operating.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/referrers.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/general.php
    • > /wp-content/plugins/cp-analytics-pro/classes/template/social.php
  • 243× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/cp-analytics-pro/google/Service/Games.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/cp-analytics-pro/google/Service/IdentityToolkit.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/cp-analytics-pro/google/Service/AndroidPublisher.php:32
    • > PHP Warning
      require_once(CPA_GOOGLE_PATHException.php): failed to open stream: No such file or directory in wp-content/plugins/cp-analytics-pro/google/Auth/Exception.php on line 18
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/cp-analytics-pro/google/back/Service_ee/TagManager.php:31
    • > PHP Fatal error
      require_once(): Failed opening required 'CPA_GOOGLE_PATHIO/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/cp-analytics-pro/google/IO/Curl.php on line 24
    • > PHP Fatal error
      Uncaught Error: Class 'Cp_Analytics' not found in wp-content/plugins/cp-analytics-pro/classes/gap_option_settings.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Service' not found in wp-content/plugins/cp-analytics-pro/google/back/Service_ee/Storage.php:31
    • > PHP Fatal error
      require_once(): Failed opening required 'Auth/Abstract.php' (include_path='.:/usr/share/php') in wp-content/plugins/cp-analytics-pro/google/Auth/Simple.php on line 18
    • > PHP Fatal error
      require_once(): Failed opening required 'CPA_GOOGLE_PATHClient.php' (include_path='.:/usr/share/php') in wp-content/plugins/cp-analytics-pro/google/Http/REST.php on line 18

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gap_dashboard
    • > Javascript (severe) in unknown
    /wp-content/plugins/cp-analytics-pro/assets/js/bootstrap.min.js?ver=6.3.1 5:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gap_dashboard
    • > Javascript (severe) in unknown
    /wp-content/plugins/cp-analytics-pro/assets/css/bootstrap-select.min.css?ver=6.3.1 5:46 Uncaught SyntaxError: Unexpected token '{'

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: No descriptions were found for these screenshots #10, #11, #12, #13, #14, #3, #4, #5, #6, #7, #8, #9 in cp-analytics-pro/assets to your readme.txt
Please take inspiration from this readme.txt

cp-analytics-pro/cpanalytics.php 85% from 13 tests

"CP Analytics pro" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("cp-analytics-pro.php" instead of "cpanalytics.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 263 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected306,737 lines of code in 257 files:
LanguageFilesBlank linesComment linesLines of code
PHP23029,19757,189295,112
CSS122141545,312
JavaScript129929055,158
SVG3001,155

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.01
Average class complexity1.16
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity1.02
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes5,395
▷ Abstract classes50.09%
▷ Concrete classes5,39099.91%
▷ Final classes00.00%
Methods42,980
▷ Static methods220.05%
▷ Public methods42,87799.76%
▷ Protected methods300.07%
▷ Private methods730.17%
Functions15
▷ Named functions1386.67%
▷ Anonymous functions213.33%
Constants461
▷ Global constants91.95%
▷ Class constants45298.05%
▷ Public constants452100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
28 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
assets/css/jquery-ui-theme/images/ui-bg_highlight-soft_45_5f5964_1x100.png0.42KB0.21KB▼ 49.77%
assets/css/jquery-ui-theme/images/ui-bg_flat_55_994d53_40x100.png0.29KB0.11KB▼ 60.68%
assets/css/jquery-ui-theme/images/ui-bg_highlight-soft_100_eae6ea_1x100.png0.44KB0.19KB▼ 55.61%
assets/css/jquery-ui-theme/images/ui-bg_flat_0_aaaaaa_40x100.png0.28KB0.11KB▼ 59.30%