78% xcoobee

Code Review | XcooBee for WordPress

WordPress plugin XcooBee for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: xcoobee
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 8, 2019
  • Latest release: Feb 2, 2020
  • Number of updates: 39
  • Update frequency: every 10.1 days
  • Top authors: xcoobee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,448 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲1.50MB] [CPU: ▲6.01ms] 75% from 4 tests

Analyzing server-side resources used by XcooBee for WordPress
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,860.52ms on /wp-admin/admin.php?page=xcoobee&tab=addons)
PageMemory (MB)CPU Time (ms)
Home /4.94 ▲1.4858.25 ▲12.40
Dashboard /wp-admin4.87 ▲1.5264.96 ▼4.04
Posts /wp-admin/edit.php4.92 ▲1.5672.62 ▲13.36
Add New Post /wp-admin/post-new.php7.40 ▲1.5299.72 ▲2.31
Media Library /wp-admin/upload.php4.73 ▲1.5054.70 ▲17.99
Addons /wp-admin/admin.php?page=xcoobee&tab=addons4.921,860.52
General /wp-admin/admin.php?page=xcoobee4.7347.61

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for XcooBee for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲18914.05 ▼0.3310.54 ▲8.3344.55 ▲4.07
Dashboard /wp-admin2,266 ▲814.97 ▼0.91104.69 ▼16.9273.74 ▲27.47
Posts /wp-admin/edit.php2,161 ▲692.11 ▲0.1242.49 ▲4.7235.91 ▼4.96
Add New Post /wp-admin/post-new.php1,563 ▲3521.63 ▼1.36735.10 ▲70.3360.31 ▲1.66
Media Library /wp-admin/upload.php1,457 ▲694.24 ▲0.00104.45 ▼7.6265.15 ▲18.87
Addons /wp-admin/admin.php?page=xcoobee&tab=addons1,1392.3626.7327.28
General /wp-admin/admin.php?page=xcoobee1,0452.1126.7237.96

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

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/xcoobee/includes/sdk/test/integration/bootstrap.php
  • 281× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/monolog/monolog/tests/Monolog/Formatter/WildfireFormatterTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'XcooBee\\Test\\TestCase' not found in wp-content/plugins/xcoobee/includes/sdk/test/src/XcooBee/Http/ClientTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/guzzlehttp/promises/src/AggregateException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/xcoobee/includes/sdk/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught XcooBee\\Exception\\XcooBeeException: File /home/potrivit/.xcoobee/config doesn't exist in wp-content/plugins/xcoobee/includes/sdk/src/XcooBee/Models/ConfigModel.php:83

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: gdpr, consent, privacy, security, cookie...

xcoobee/xcoobee.php 92% from 13 tests

The main PHP file in "XcooBee for WordPress" ver. 1.7.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 148 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin60,691 lines of code in 491 files:
LanguageFilesBlank linesComment linesLines of code
PHP41110,55026,77052,473
Markdown291,92605,412
JSON15001,265
SVG1114539
JavaScript117588400
CSS6911396
HTML11596
XML514076
YAML12025
make1409

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.38
▷ Minimum class complexity1.00
▷ Maximum class complexity628.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces49
Interfaces33
Traits4
Classes406
▷ Abstract classes112.71%
▷ Concrete classes39597.29%
▷ Final classes82.03%
Methods3,246
▷ Static methods1805.55%
▷ Public methods2,80286.32%
▷ Protected methods2457.55%
▷ Private methods1996.13%
Functions320
▷ Named functions8426.25%
▷ Anonymous functions23673.75%
Constants313
▷ Global constants299.27%
▷ Class constants28490.73%
▷ Public constants284100.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
1 PNG file occupies 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/sdk/example/assets/nature.png89.48KB28.14KB▼ 68.55%