89% phpsword-google-analytics

Code Review | Pk Google Analytics

WordPress plugin Pk Google Analytics scored89%from 54 tests.

About plugin

  • Plugin page: phpsword-google-a...
  • Plugin version: 3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2014
  • Latest release: Jul 31, 2022
  • Number of updates: 46
  • Update frequency: every 61.5 days
  • Top authors: phpsword (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

800+ active /12,860 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Analyzing server-side resources used by Pk Google Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0134.27 ▼8.65
Dashboard /wp-admin3.33 ▼0.0248.68 ▼13.49
Posts /wp-admin/edit.php3.38 ▲0.0247.64 ▼3.49
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.22 ▼6.95
Media Library /wp-admin/upload.php3.25 ▲0.0235.15 ▲1.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pk Google Analytics
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.17 ▼0.201.88 ▲0.3251.68 ▲10.55
Dashboard /wp-admin2,208 ▲285.64 ▲0.0489.75 ▼1.5941.58 ▼4.30
Posts /wp-admin/edit.php2,119 ▲192.03 ▼0.0940.08 ▲3.0436.96 ▼1.05
Add New Post /wp-admin/post-new.php1,549 ▲2323.08 ▼0.69626.96 ▼68.4165.01 ▼0.84
Media Library /wp-admin/upload.php1,419 ▲224.18 ▼0.02106.64 ▼2.4343.46 ▼3.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

phpsword-google-analytics/index.php 69% from 13 tests

"Pk Google Analytics" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.0.1" instead of "5.6")
  • Description: The description should be shorter than 140 characters (currently 296 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("phpsword-google-analytics.php" instead of "index.php")

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
No dangerous file extensions were detected83 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3213783

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity10.00
▷ Minimum class complexity10.00
▷ Maximum class complexity10.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 images were found in this plugin