83% eu-tube-user-privacy

Code Review | EU Tube User Privacy

WordPress plugin EU Tube User Privacy scored 83% from 54 tests.

About plugin

  • Plugin page: eu-tube-user-privacy
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.5.2
  • WordPress version: 6.3.1
  • First release: May 28, 2015
  • Latest release: May 12, 2016
  • Number of updates: 6
  • Update frequency: every 59.5 days
  • Top authors: ema-digital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,485 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by EU Tube User Privacy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.20 ▼5.05
Dashboard /wp-admin3.32 ▲0.0143.58 ▼12.60
Posts /wp-admin/edit.php3.37 ▲0.0141.91 ▼0.53
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.22 ▲4.10
Media Library /wp-admin/upload.php3.24 ▲0.0131.82 ▼1.52

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for EU Tube User Privacy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.29 ▼1.091.75 ▼0.4541.07 ▼12.50
Dashboard /wp-admin2,209 ▲244.84 ▼0.9697.64 ▼21.8039.29 ▼12.73
Posts /wp-admin/edit.php2,089 ▼32.12 ▲0.0735.04 ▼1.2133.26 ▼5.03
Add New Post /wp-admin/post-new.php1,514 ▼2021.72 ▼1.47731.70 ▲53.2457.12 ▲5.70
Media Library /wp-admin/upload.php1,391 ▲34.18 ▲0.00100.49 ▼38.3047.92 ▼9.21

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
The following issues need your attention
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/eu-tube-user-privacy/tests/EMAYoutubeNocookieTest.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/eu-tube-user-privacy/lib/EMAYoutubeNocookieAdmin.php:128
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/eu-tube-user-privacy/plugin.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (Polylang options screen)
You can take inspiration from this readme.txt

eu-tube-user-privacy/plugin.php 85% from 13 tests

The principal PHP file in "EU Tube User Privacy" v. 0.2.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("eu-tube-user-privacy.php" instead of "plugin.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected180 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP52550153
CSS12014
XML1008
JSON1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity3.33
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods11100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.06MB with 0.04MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png60.88KB22.04KB▼ 63.79%