83% danp-google-analytics-pageview-sync

Code Review | DanP Google Analytics Pageview Sync

WordPress plugin DanP Google Analytics Pageview Sync scored83%from 54 tests.

About plugin

  • Plugin page: danp-google-analy...
  • Plugin version: 1.0.1
  • PHP compatiblity: 8.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Jan 13, 2022
  • Latest release: Jan 26, 2022
  • Number of updates: 20
  • Update frequency: every 0.7 days
  • Top authors: danpoulton (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /370 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼8.56ms] Passed 4 tests

A check of server-side resources used by DanP Google Analytics Pageview Sync
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.07 ▲1.12
Dashboard /wp-admin3.31 ▼0.0445.99 ▼12.86
Posts /wp-admin/edit.php3.36 ▲0.0043.82 ▼7.40
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.21 ▼13.99
Media Library /wp-admin/upload.php3.23 ▲0.0034.52 ▲0.03

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for DanP Google Analytics Pageview Sync
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.171.60 ▼0.2443.52 ▲4.56
Dashboard /wp-admin2,206 ▲174.89 ▼0.0799.34 ▼8.5035.64 ▼6.75
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0033.08 ▼7.6835.07 ▼1.91
Add New Post /wp-admin/post-new.php1,528 ▲923.09 ▼0.05674.87 ▲34.8757.08 ▲6.65
Media Library /wp-admin/upload.php1,391 ▲34.19 ▼0.0595.68 ▲1.1541.31 ▲0.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 355× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\PHP\\Reductions\\Montgomery' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/MontgomeryMult.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractSyslogHandler' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\DES' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/TripleDES.php:46
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Keys\\PKCS8' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA/Formats/Keys/PSS.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheItemPoolInterface' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/google/auth/src/Cache/SysVCacheItemPool.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Binary' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect131r2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Base' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/BaseCurves/Binary.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\Curves\\secp192r1' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/nistp192.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\StreamCipher' not found in wp-content/plugins/danp-google-analytics-pageview-sync/google-api-php-client--PHP8.0/vendor/phpseclib/phpseclib/phpseclib/Crypt/Salsa20.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: google analytics, page views, pageviews

danp-google-analytics-pageview-sync/danp-ga.php 77% from 13 tests

The main PHP file in "DanP Google Analytics Pageview Sync" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("danp-google-analytics-pageview-sync.php" instead of "danp-ga.php")
  • Description: The description should be shorter than 140 characters (currently 166 characters long)
  • Requires PHP: Required version must be the same as the one declared in readme.txt ("8.0" instead of "8.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected61,449 lines of code in 676 files:
LanguageFilesBlank linesComment linesLines of code
PHP63311,46738,13654,697
Markdown191,62404,799
JSON16001,844
YAML36156
XML30041
make1409
Bourne Shell1203

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.08
▷ Minimum class complexity1.00
▷ Maximum class complexity661.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces71
Interfaces26
Traits12
Classes597
▷ Abstract classes21235.51%
▷ Concrete classes38564.49%
▷ Final classes5213.51%
Methods3,116
▷ Static methods66521.34%
▷ Public methods2,25872.46%
▷ Protected methods38412.32%
▷ Private methods47415.21%
Functions173
▷ Named functions3520.23%
▷ Anonymous functions13879.77%
Constants488
▷ Global constants153.07%
▷ Class constants47396.93%
▷ Public constants44093.02%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png4.15KB1.60KB▼ 61.39%
assets/banner-772x250.png9.07KB4.41KB▼ 51.35%
assets/screenshot-1.png42.61KB25.99KB▼ 39.01%
assets/banner-1544x500.png18.18KB9.92KB▼ 45.44%
assets/icon-256x256.png6.73KB3.16KB▼ 53.06%