78% bea-media-analytics

Code Review | BEA - Media Analytics

WordPress plugin BEA - Media Analytics scored 78% from 54 tests.

About plugin

  • Plugin page: bea-media-analytics
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.3
  • WordPress version: 5.8.1
  • First release: Feb 4, 2018
  • Latest release: Apr 5, 2018
  • Number of updates: 20
  • Update frequency: every 3.0 days
  • Top authors: MaximeCulea (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active / 2,528 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼137.98ms] Passed 4 tests

Analyzing server-side resources used by BEA - Media Analytics
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.10 ▲0.3849.31 ▲26.73
Dashboard /wp-admin3.42 ▲0.3665.18 ▲15.76
Posts /wp-admin/edit.php3.46 ▲0.3650.70 ▲3.11
Add New Post /wp-admin/post-new.php5.77 ▲0.3499.82 ▼584.24
Media Library /wp-admin/upload.php3.36 ▲0.3540.49 ▲13.45

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 50 new files
Database: 1 new table, no new options
New tables

Browser metrics Passed 4 tests

An overview of browser requirements for BEA - Media Analytics
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,697 ▲12515.87 ▼0.158.16 ▼3.1748.42 ▲3.02
Dashboard /wp-admin2,988 ▲605.96 ▼0.02151.56 ▼16.02106.75 ▼9.12
Posts /wp-admin/edit.php2,758 ▲192.73 ▲0.0169.90 ▼5.7590.18 ▲2.65
Add New Post /wp-admin/post-new.php1,698 ▼2,03718.51 ▼0.07376.49 ▼123.85108.75 ▼18.62
Media Library /wp-admin/upload.php1,832 ▲225.05 ▲0.01155.16 ▲4.94124.38 ▼0.93

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
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_bea_media_analytics

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/bea-media-analytics/bea-media-analytics.php
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant BEA_MEDIA_ANALYTICS_DIR - assumed 'BEA_MEDIA_ANALYTICS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/bea-media-analytics/autoload.php on line 196
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/upgrader.php on line 3
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/db.php on line 3
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/admin/option.php on line 7
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/admin/main.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/bea-media-analytics/classes/wp-cli/unused.php:5
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/crons.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'BEA\\Media_Analytics\\Helper\\Helper' not found in wp-content/plugins/bea-media-analytics/classes/helper/option.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/bea-media-analytics/classes/wp-cli/index-site.php:6
    • > PHP Fatal error
      Trait 'BEA\\Media_Analytics\\Singleton' not found in wp-content/plugins/bea-media-analytics/classes/wp-cli/main.php on line 5

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

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: find media, find, media, analytics, usage

bea-media-analytics/bea-media-analytics.php 85% from 13 tests

Analyzing the main PHP file in "BEA - Media Analytics" version 2.1.1
It is important to fix the following:
  • Domain Path: The domain path should use only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,123 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PO File13234134

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.06
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes32100.00%
▷ Final classes13.12%
▷ Static methods3924.07%
▷ Public methods12275.31%
▷ Protected methods2314.20%
▷ Private methods1710.49%
▷ Named functions770.00%
▷ Anonymous functions330.00%
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin