84% open-web-analytics

Code Review | Open Web Analytics for WordPress

WordPress plugin Open Web Analytics for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: open-web-analytics
  • Plugin version: 2.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Aug 10, 2008
  • Latest release: Dec 6, 2022
  • Number of updates: 14
  • Update frequency: every 373.5 days
  • Top authors: padams (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,998 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▼3.42ms] Passed 4 tests

Analyzing server-side resources used by Open Web Analytics for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.87 ▲0.4144.61 ▼1.08
Dashboard /wp-admin3.89 ▲0.5845.51 ▼5.65
Posts /wp-admin/edit.php3.92 ▲0.5752.19 ▲1.94
Add New Post /wp-admin/post-new.php6.58 ▲0.6994.73 ▼8.88
Media Library /wp-admin/upload.php3.82 ▲0.6044.07 ▲3.46
Analytics /wp-admin/admin.php?page=owa-analytics3.7437.66
Settings /wp-admin/admin.php?page=owa-wordpress3.7438.18

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 178 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Open Web Analytics for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,882 ▲12113.22 ▼1.072.90 ▲0.8943.40 ▲1.25
Dashboard /wp-admin2,255 ▲554.88 ▼1.03108.36 ▲5.4442.07 ▼6.69
Posts /wp-admin/edit.php2,134 ▲312.15 ▲0.1540.59 ▼4.0737.74 ▼1.80
Add New Post /wp-admin/post-new.php1,579 ▲3423.32 ▲0.24696.70 ▲95.8157.33 ▲0.91
Media Library /wp-admin/upload.php1,434 ▲344.22 ▲0.05106.99 ▲0.4047.83 ▲1.62
Analytics /wp-admin/admin.php?page=owa-analytics7992.0429.4627.15
Settings /wp-admin/admin.php?page=owa-wordpress1,0742.2133.3631.68

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
Almost there! Just fix the following items
  • 61× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/open-web-analytics/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/Uri.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/Stream.php:12
    • > PHP Warning
      require_once(wp-content/plugins/open-web-analytics/vendor/open-web-analytics/owa-php-sdk/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/open-web-analytics/vendor/open-web-analytics/owa-php-sdk/owa-autoloader.php on line 22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/MultipartStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/open-web-analytics/vendor/guzzlehttp/psr7/src/InflateStream.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Tracking Settings)
You can look at the official readme.txt

open-web-analytics/owa-plugin.php 92% from 13 tests

The main file in "Open Web Analytics for WordPress" v. 2.1.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("open-web-analytics.php" instead of "owa-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected19,260 lines of code in 161 files:
LanguageFilesBlank linesComment linesLines of code
PHP1523,8676,63217,226
Markdown629101,091
JSON100934
YAML2119

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity15.61
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces20
Interfaces26
Traits3
Classes102
▷ Abstract classes00.00%
▷ Concrete classes102100.00%
▷ Final classes3837.25%
Methods1,048
▷ Static methods22121.09%
▷ Public methods88284.16%
▷ Protected methods40.38%
▷ Private methods16215.46%
Functions178
▷ Named functions8547.75%
▷ Anonymous functions9352.25%
Constants112
▷ Global constants4540.18%
▷ Class constants6759.82%
▷ Public constants5683.58%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin