78% ga-pvcounter

Code Review | GA-PVcounter

WordPress plugin GA-PVcounter scored 78% from 54 tests.

About plugin

  • Plugin page: ga-pvcounter
  • Plugin version: 0.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.6
  • WordPress version: 5.8.1
  • First release: Aug 20, 2013
  • Latest release: Oct 1, 2013
  • Number of updates: 5
  • Update frequency: every 8.4 days
  • Top authors: enomoto celtislab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,073 total downloads


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.19MB] [CPU: ▼137.32ms] Passed 4 tests

This is a short check of server-side resources used by GA-PVcounter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.2037.57 ▼0.01
Dashboard /wp-admin3.25 ▲0.2051.76 ▲1.35
Posts /wp-admin/edit.php3.36 ▲0.2658.10 ▲16.96
Add New Post /wp-admin/post-new.php5.61 ▲0.18109.68 ▼565.33
Media Library /wp-admin/upload.php3.19 ▲0.1950.57 ▲14.70
GA-PVcounter /wp-admin/options-general.php?page=ga-pvcounter/GA-PVcounter.php2.2111.16

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 98 new files
Database: no new tables, 2 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by GA-PVcounter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,837 ▲24118.75 ▲3.0922.89 ▲12.9550.22 ▲0.90
Dashboard /wp-admin2,975 ▲416.09 ▼0.07149.37 ▼17.62112.72 ▲0.89
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0072.72 ▼4.4891.39 ▼3.40
Add New Post /wp-admin/post-new.php1,584 ▼9916.68 ▼1.72469.47 ▲59.94141.72 ▲25.76
Media Library /wp-admin/upload.php1,812 ▲55.00 ▼0.04194.09 ▲22.08132.15 ▲10.80
GA-PVcounter /wp-admin/options-general.php?page=ga-pvcounter/GA-PVcounter.php1,2902.0668.6288.89

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 2 options
    • widget_ga_pvwidget
    • widget_ga_pv_recent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=ga-pvcounter/GA-PVcounter.php
    • > Deprecated in wp-content/plugins/ga-pvcounter/google-api-php-client/src/service/Google_Utils.php+58
    Array and string offset access syntax with curly braces is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 64× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_SiteVerificationService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_IO' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/io/Google_HttpStreamIO.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_PagespeedonlineService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_OrkutService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_DriveService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_TasksService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_GanService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Cache' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/cache/Google_ApcCache.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_CustomsearchService.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/ga-pvcounter/google-api-php-client/src/contrib/Google_WebfontsService.php:25

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


Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Setup screen for authentication required to get the Google Analytics data), #2 (Setting screen of options, and profile ID), #3 (Setting screen of GA-PVcounter widget), #4 (Display example of popular posts and page view chart tabbed), #5 (Display of only PV chart is also available), #6 (Show only popular posts using short code), #7 (Setting screen of Recent posts widget), #8 (Display example of recent posts and small pv chart)
The official readme.txt is a good inspiration

ga-pvcounter/GA-PVcounter.php 85% from 13 tests

The entry point to "GA-PVcounter" version 0.4.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Name the main plugin file the same as the plugin slug ("ga-pvcounter.php" instead of "GA-PVcounter.php")

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
Success! There were no dangerous files found in this plugin52,948 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PO File14950158

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.05
Average class complexity1.88
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity1.11
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
▷ Abstract classes50.36%
▷ Concrete classes1,37999.64%
▷ Final classes00.00%
▷ Static methods190.17%
▷ Public methods11,31099.68%
▷ Protected methods90.08%
▷ Private methods270.24%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants20100.00%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-7.png2.48KB2.46KB▼ 0.79%
screenshot-5.png1.83KB1.81KB▼ 1.33%
screenshot-8.png21.26KB20.88KB▼ 1.79%
screenshot-2.png4.25KB4.00KB▼ 5.99%
screenshot-1.png31.24KB30.32KB▼ 2.94%