84% marctv-mediaelement-tracking

Code Review | MediaElement Google Analytics & Piwik Event Tracking

WordPress plugin MediaElement Google Analytics & Piwik Event Tracking scored 84% from 54 tests.

About plugin

  • Plugin page: marctv-mediaeleme...
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.6
  • WordPress version: 6.3.1
  • First release: Mar 16, 2016
  • Latest release: Jan 16, 2021
  • Number of updates: 24
  • Update frequency: every 73.6 days
  • Top authors: MarcDK (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,460 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.55ms] Passed 4 tests

A check of server-side resources used by MediaElement Google Analytics & Piwik Event Tracking
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.05 ▼3.90
Dashboard /wp-admin3.31 ▲0.0146.01 ▼2.10
Posts /wp-admin/edit.php3.36 ▲0.0045.02 ▼6.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.04 ▼21.47
Media Library /wp-admin/upload.php3.23 ▲0.0037.84 ▲2.76

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for MediaElement Google Analytics & Piwik Event Tracking
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲14614.04 ▼0.325.42 ▲3.6138.76 ▼8.46
Dashboard /wp-admin2,206 ▲154.85 ▼0.1895.23 ▼9.7438.48 ▼1.79
Posts /wp-admin/edit.php2,089 ▼32.02 ▼0.0134.84 ▼7.8335.41 ▼2.96
Add New Post /wp-admin/post-new.php1,514 ▼017.84 ▲0.38668.46 ▲5.1656.66 ▲0.29
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.0296.64 ▼4.4541.91 ▼4.28

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/marctv-mediaelement-tracking/marctv-mediaelement-ga-events.php:20

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 96% from 29 tests

readme.txt Passed 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
4 plugin tags: google analytics, tracking, matomo, video

marctv-mediaelement-tracking/marctv-mediaelement-ga-events.php 92% from 13 tests

The main file in "MediaElement Google Analytics & Piwik Event Tracking" v. 1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("marctv-mediaelement-tracking.php" instead of "marctv-mediaelement-ga-events.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin70 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1323260
PHP15910

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin