83% logicrays-recent-post-widget

Code Review | Logicrays Recent Post Widget

WordPress plugin Logicrays Recent Post Widget scored83%from 54 tests.

About plugin

  • Plugin page: logicrays-recent-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.4
  • WordPress version: 6.3.1
  • First release: Apr 3, 2018
  • Latest release: Apr 3, 2018
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: logicrays (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /544 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
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.36ms] Passed 4 tests

Server-side resources used by Logicrays Recent Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.48 ▼2.03
Dashboard /wp-admin3.34 ▲0.0446.07 ▼2.46
Posts /wp-admin/edit.php3.39 ▲0.0447.05 ▲0.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0478.47 ▼17.33
Media Library /wp-admin/upload.php3.26 ▲0.0435.35 ▲2.41

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Logicrays Recent Post Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3513.64 ▼0.663.45 ▲1.2641.85 ▼0.63
Dashboard /wp-admin2,203 ▲155.83 ▼0.0394.41 ▼17.7438.02 ▼5.78
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0139.41 ▲2.9034.76 ▼0.26
Add New Post /wp-admin/post-new.php1,546 ▲3223.36 ▲5.78650.00 ▲1.5049.51 ▲0.49
Media Library /wp-admin/upload.php1,391 ▲64.14 ▼0.1398.55 ▼2.3443.36 ▲1.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_lr_recent_post_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/logicrays-recent-post-widget/lr_recent_post_widget.php:18

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 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

logicrays-recent-post-widget/lr_recent_post_widget.php 92% from 13 tests

The main file in "Logicrays Recent Post Widget" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("logicrays-recent-post-widget.php" instead of "lr_recent_post_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,468 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1847452,112
PHP1420206
CSS2141150

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banner-772-250.png45.95KB16.81KB▼ 63.41%