84% lh-display-posts-shortcode

Code Review | LH Display Posts Shortcode

WordPress plugin LH Display Posts Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: lh-display-posts-...
  • Plugin version: 1.01
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 6, 2019
  • Latest release: Aug 7, 2022
  • Number of updates: 4
  • Update frequency: every 289.5 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /569 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by LH Display Posts Shortcode
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0145.34 ▲3.38
Dashboard /wp-admin3.32 ▼0.0345.39 ▼19.13
Posts /wp-admin/edit.php3.37 ▲0.0149.24 ▲3.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.16 ▼13.53
Media Library /wp-admin/upload.php3.24 ▲0.0134.06 ▼0.41

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for LH Display Posts Shortcode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.32 ▼0.041.65 ▲0.0840.72 ▼5.33
Dashboard /wp-admin2,198 ▲205.59 ▼0.0290.59 ▼8.5438.12 ▼0.14
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0338.40 ▲0.8335.10 ▼0.49
Add New Post /wp-admin/post-new.php1,548 ▲1918.02 ▼5.66603.48 ▼93.3371.92 ▲15.17
Media Library /wp-admin/upload.php1,400 ▲34.16 ▼0.0894.67 ▼5.8642.31 ▼0.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: display_posts in wp-content/plugins/lh-display-posts-shortcode/lh_dps-templates/default-template.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

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: list, display, pages, query, posts...

lh-display-posts-shortcode/lh-display-posts-shortcode.php 92% from 13 tests

The primary PHP file in "LH Display Posts Shortcode" version 1.01 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

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
No dangerous file extensions were detected86 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3602086

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods233.33%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin