83% wp-mercure

Code Review | WP Mercure

WordPress plugin WP Mercure scored 83% from 54 tests.

About plugin

  • Plugin page: wp-mercure
  • Plugin version: 0.1
  • PHP compatiblity: 7.1.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 6.3.1
  • First release: Aug 6, 2020
  • Latest release: Nov 25, 2020
  • Number of updates: 6
  • Update frequency: every 18.7 days
  • Top authors: cdecou (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 345 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼6.11ms] Passed 4 tests

Analyzing server-side resources used by WP Mercure
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0943.64 ▲3.90
Dashboard /wp-admin3.44 ▲0.1356.14 ▲6.19
Posts /wp-admin/edit.php3.55 ▲0.1950.73 ▼3.63
Add New Post /wp-admin/post-new.php6.02 ▲0.1398.51 ▲2.24
Media Library /wp-admin/upload.php3.36 ▲0.1336.71 ▼26.96
Mercure /wp-admin/admin.php?page=wpmercure-admin3.3334.56
Features /wp-admin/admin.php?page=wpmercure-features3.3336.20

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

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

Browser metrics Passed 4 tests

WP Mercure: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲2713.24 ▼0.391.86 ▼0.1741.57 ▼2.26
Dashboard /wp-admin2,233 ▲245.86 ▲0.81109.10 ▼1.0241.73 ▼3.41
Posts /wp-admin/edit.php2,116 ▲242.03 ▼0.0240.33 ▲1.0534.87 ▼1.51
Add New Post /wp-admin/post-new.php1,555 ▲923.28 ▼0.77601.31 ▼142.6348.94 ▼4.00
Media Library /wp-admin/upload.php1,415 ▲274.17 ▼0.04101.48 ▼3.5843.84 ▲3.02
Mercure /wp-admin/admin.php?page=wpmercure-admin8322.0425.1531.19
Features /wp-admin/admin.php?page=wpmercure-features8302.0324.7824.98

Uninstaller [IO: ✅] [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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

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)
Everything seems fine, however 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
  • 58× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Amp\\Http\\Client\\EventListener' not found in wp-content/plugins/wp-mercure/vendor/symfony/http-client/Internal/AmpListener.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\ServerExceptionInterface' not found in wp-content/plugins/wp-mercure/vendor/symfony/http-client/Exception/ServerException.php:21
    • > PHP Fatal error
      Uncaught Exception: You cannot run this script directly, it's a fixture for TestHttpServer. in wp-content/plugins/wp-mercure/vendor/symfony/http-client-contracts/Test/Fixtures/web/index.php:5
    • > PHP Fatal error
      Cannot declare class JsonException, because the name is already in use in wp-content/plugins/wp-mercure/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-mercure/vendor/symfony/http-client-contracts/Exception/DecodingExceptionInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\Exception\\HttpExceptionInterface' not found in wp-content/plugins/wp-mercure/vendor/symfony/http-client-contracts/Exception/ClientExceptionInterface.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WpMercure\\Features\\AbstractFeature' not found in wp-content/plugins/wp-mercure/Features/LivePost.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\HttpClient\\HttpClientInterface' not found in wp-content/plugins/wp-mercure/vendor/symfony/http-client/NoPrivateNetworkHttpClient.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-mercure/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/wp-mercure/vendor/psr/container/src/NotFoundExceptionInterface.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: notification, real-time, realtime, update, mercure...

wp-mercure/wp-mercure.php 92% from 13 tests

The main PHP script in "WP Mercure" version 0.1 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 detected8,588 lines of code in 135 files:
LanguageFilesBlank linesComment linesLines of code
PHP1081,9072,6997,381
JSON1200912
Markdown12710203
PO File1161649
JavaScript27143

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity12.89
▷ Minimum class complexity1.00
▷ Maximum class complexity161.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces25
Interfaces22
Traits7
Classes73
▷ Abstract classes56.85%
▷ Concrete classes6893.15%
▷ Final classes3348.53%
Methods484
▷ Static methods7715.91%
▷ Public methods41585.74%
▷ Protected methods102.07%
▷ Private methods5912.19%
Functions91
▷ Named functions1314.29%
▷ Anonymous functions7885.71%
Constants13
▷ Global constants17.69%
▷ Class constants1292.31%
▷ Public constants1191.67%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 1.62MB with 1.09MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/._icon-256x256.png4.00KB0.00KB▼ 100.00%
assets/icon-256x256.png29.07KB14.02KB▼ 51.78%
assets/screenshot-1.png1,611.32KB539.75KB▼ 66.50%
assets/icon-128x128.png12.35KB6.18KB▼ 49.98%