83% reuters-direct

Code Review | Reuters Direct

WordPress plugin Reuters Direct scored83%from 54 tests.

About plugin

  • Plugin page: reuters-direct
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.4
  • WordPress version: 6.3.1
  • First release: Apr 1, 2015
  • Latest release: Apr 28, 2020
  • Number of updates: 61
  • Update frequency: every 30.4 days
  • Top authors: RNAGS (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /4,287 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼4.37ms] 75% from 4 tests

A check of server-side resources used by Reuters Direct
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 649.84ms on /wp-admin/options-general.php?page=Reuters_Direct_Settings)
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4439.41 ▲3.41
Dashboard /wp-admin3.77 ▲0.4642.90 ▼3.23
Posts /wp-admin/edit.php3.82 ▲0.4750.58 ▼9.52
Add New Post /wp-admin/post-new.php6.29 ▲0.4081.99 ▼8.13
Media Library /wp-admin/upload.php3.63 ▲0.4038.45 ▲6.28
Reuters Direct /wp-admin/options-general.php?page=Reuters_Direct_Settings3.68649.84

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

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

Browser metrics Passed 4 tests

Reuters Direct: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,517 ▼24414.07 ▼0.551.80 ▲0.3038.75 ▼2.16
Dashboard /wp-admin1,921 ▼2565.89 ▲0.28123.27 ▲38.2344.44 ▲2.29
Posts /wp-admin/edit.php2,116 ▲193.06 ▲1.0992.41 ▲57.3834.11 ▼1.95
Add New Post /wp-admin/post-new.php1,547 ▲1922.29 ▼0.92648.69 ▼15.3732.94 ▼17.74
Media Library /wp-admin/upload.php1,413 ▲135.51 ▲1.27157.75 ▲52.3843.09 ▼3.16
Reuters Direct /wp-admin/options-general.php?page=Reuters_Direct_Settings8702.8669.6253.68

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • Reuters_Direct_version
    • widget_recent-comments

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/reuters-direct/includes/vendor/katzgrau/klogger/tests/LoggerTest.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/reuters-direct/includes/vendor/psr/log/Psr/Log/NullLogger.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/reuters-direct/includes/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/reuters-direct/includes/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Psr\\Log\\AbstractLogger' not found in wp-content/plugins/reuters-direct/includes/vendor/katzgrau/klogger/src/Logger.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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 to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Screenshot-1: Configuration screen of Reuters Direct), #2 (Screenshot-2: Configuration screen cont.), #3 (Screenshot-3: Configuration screen cont.), #4 (Screenshot-4: Posts screen in WordPress show the post tagging for Online Reports wo/ Images), #5 (Screenshot-5: Media gallery), #6 (Screenshot-6: Image detail screen showing attached metadata)
You can look at the official readme.txt

reuters-direct/reuters-direct.php 85% from 13 tests

This is the main PHP file of "Reuters Direct" version 3.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 226 characters long)
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected2,961 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP223317452,235
CSS1138266
Markdown2810208
JSON400164
JavaScript17870
XML10018

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.47
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces4
Interfaces2
Traits2
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods128
▷ Static methods53.91%
▷ Public methods12194.53%
▷ Protected methods32.34%
▷ Private methods43.12%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 2.51MB with 1.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png100.44KB47.53KB▼ 52.68%
screenshot-3.png39.00KB21.08KB▼ 45.96%
screenshot-6.png983.19KB191.25KB▼ 80.55%
assets/css/rwd_logo.png2.41KB1.79KB▼ 25.64%
screenshot-5.png1,338.49KB283.98KB▼ 78.78%