78% mediamask

Code Review | Mediamask

WordPress plugin Mediamask scored78%from 54 tests.

About plugin

  • Plugin page: mediamask
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 26, 2022
  • Latest release: Oct 16, 2023
  • Number of updates: 13
  • Update frequency: every 32.0 days
  • Top authors: mediamask (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,253 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 gracefully, with no errors

Server metrics [RAM: ▲0.68MB] [CPU: ▼6.44ms] Passed 4 tests

An overview of server-side resources used by Mediamask
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7046.21 ▲3.36
Dashboard /wp-admin4.00 ▲0.6551.57 ▼13.66
Posts /wp-admin/edit.php4.11 ▲0.7554.13 ▲2.45
Add New Post /wp-admin/post-new.php6.60 ▲0.7088.49 ▼17.92
Media Library /wp-admin/upload.php3.92 ▲0.6941.23 ▲5.04

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Mediamask
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5914.24 ▼0.111.65 ▼0.1638.84 ▼4.25
Dashboard /wp-admin2,214 ▲375.57 ▼0.0383.68 ▼12.6340.04 ▼3.06
Posts /wp-admin/edit.php2,116 ▲162.00 ▼0.0143.03 ▲7.1736.05 ▼1.58
Add New Post /wp-admin/post-new.php1,542 ▲1423.28 ▲0.24658.53 ▲11.1750.79 ▼3.49
Media Library /wp-admin/upload.php1,416 ▲194.30 ▲0.1199.77 ▼7.4341.78 ▼6.84

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mediamask/tests/bootstrap.php
    • > /wp-content/plugins/mediamask/admin/partials/plugin-mediamask-display.php
    • > /wp-content/plugins/mediamask/public/partials/mediamask-public-display.php
    • > /wp-content/plugins/mediamask/vendor/nikic/php-parser/grammar/rebuildParsers.php
  • 691× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Expr' not found in wp-content/plugins/mediamask/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Eval_.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\SyntheticError' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Framework/Exception/PHPTAssertionFailedError.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Runner\\Hook' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Runner/Hook/AfterLastTestHook.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Framework\\SelfDescribing' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Constraint\\Constraint' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Framework/Constraint/Math/IsInfinite.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\\Builder\\Declaration' not found in wp-content/plugins/mediamask/vendor/nikic/php-parser/lib/PhpParser/Builder/Enum_.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Exception' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Exception.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Framework\\MockObject\\Stub\\Stub' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Framework/MockObject/Stub/ReturnCallback.php:22
    • > PHP Warning
      rename(wp-content/plugins/mediamask/vendor/nikic/php-parser/grammar/tmp_parser.php,wp-content/plugins/mediamask/vendor/nikic/php-parser/grammar/../lib/PhpParser/Parser/Tokens.php): No such file or directory in wp-content/plugins/mediamask/vendor/nikic/php-parser/grammar/rebuildParsers.php on line 57
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\Exception' not found in wp-content/plugins/mediamask/vendor/phpunit/phpunit/src/Framework/Exception/Warning.php:15

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mediamask === )
You can look at the official readme.txt

mediamask/mediamask.php Passed 13 tests

The main PHP script in "Mediamask" version 1.0.0 is automatically included on every request by WordPress
63 characters long description:
Generate automated Open Graph images on your Wordpress Website.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin96,866 lines of code in 1,328 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,11716,50934,27576,931
Markdown903,51007,741
JSON48707,365
yacc3336122,058
XSD300964
Vuejs Component1112330889
XML1952237
Bourne Shell23420155
YAML4293154
CSS83314140
TypeScript8215125
JavaScript9127172
reStructuredText2231831
SVG4004

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 142)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.04
▷ Minimum class complexity1.00
▷ Maximum class complexity216.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity142.00
Code structure
Namespaces114
Interfaces99
Traits42
Classes952
▷ Abstract classes464.83%
▷ Concrete classes90695.17%
▷ Final classes48153.09%
Methods5,701
▷ Static methods72212.66%
▷ Public methods4,54079.64%
▷ Protected methods5279.24%
▷ Private methods63411.12%
Functions1,611
▷ Named functions24815.39%
▷ Anonymous functions1,36384.61%
Constants602
▷ Global constants40.66%
▷ Class constants59899.34%
▷ Public constants54090.30%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin