84% thirdwatch

Code Review | Thirdwatch

WordPress plugin Thirdwatch scored84%from 54 tests.

About plugin

  • Plugin page: thirdwatch
  • Plugin version: 1.1.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.4
  • WordPress version: 6.3.1
  • First release: Oct 22, 2018
  • Latest release: Oct 8, 2020
  • Number of updates: 40
  • Update frequency: every 18.0 days
  • Top authors: thirdwatch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,509 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.00MB] [CPU: ▼4.53ms] Passed 4 tests

An overview of server-side resources used by Thirdwatch
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0144.40 ▼0.23
Dashboard /wp-admin3.31 ▼0.0352.02 ▼19.01
Posts /wp-admin/edit.php3.36 ▲0.0150.15 ▲2.55
Add New Post /wp-admin/post-new.php5.89 ▲0.01101.86 ▲5.75
Media Library /wp-admin/upload.php3.24 ▲0.0137.45 ▼1.41

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Thirdwatch
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.081.67 ▲0.0439.51 ▼3.27
Dashboard /wp-admin2,198 ▲215.57 ▼0.1094.20 ▲0.3042.91 ▲6.33
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0139.97 ▲3.8638.21 ▲2.86
Add New Post /wp-admin/post-new.php1,526 ▼023.09 ▼0.03699.43 ▲38.8965.80 ▲12.00
Media Library /wp-admin/upload.php1,403 ▲64.23 ▲0.03101.04 ▼1.6147.26 ▼0.43

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

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

SRP 50% 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
Please fix the following items
  • 120× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/test/Model/SendMessageTest.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'ai\\thirdwatch\\Model\\ModelInterface' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/thirdwatch_api/Model/UnTag.php:43
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/vendor/guzzlehttp/psr7/src/MultipartStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'ai\\thirdwatch\\Model\\ModelInterface' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/thirdwatch_api/Model/BillingAddress.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/thirdwatch/includes/libraries/thirdwatch-php/test/Model/PaymentMethodTest.php:42

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt is a good inspiration

thirdwatch/thirdwatch.php 92% from 13 tests

The principal PHP file in "Thirdwatch" v. 1.1.4 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/i18n/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected27,646 lines of code in 269 files:
LanguageFilesBlank linesComment linesLines of code
PHP1985,27118,77922,594
Markdown591,47404,545
JSON700431
Bourne Shell113831
XML11020
JavaScript11014
make1409
CSS1002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.84
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces11
Interfaces15
Traits2
Classes168
▷ Abstract classes00.00%
▷ Concrete classes168100.00%
▷ Final classes84.76%
Methods2,388
▷ Static methods33213.90%
▷ Public methods2,22693.22%
▷ Protected methods451.88%
▷ Private methods1174.90%
Functions205
▷ Named functions5727.80%
▷ Anonymous functions14872.20%
Constants87
▷ Global constants1011.49%
▷ Class constants7788.51%
▷ Public constants77100.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png2.05KB0.21KB▼ 89.50%