83% latest-post-shortcode

Code Review | Latest Post Shortcode

WordPress plugin Latest Post Shortcode scored83%from 54 tests.

About plugin

  • Plugin page: latest-post-short...
  • Plugin version: 11.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2015
  • Latest release: Nov 20, 2023
  • Number of updates: 158
  • Update frequency: every 20.1 days
  • Top authors: Iulia Cazan (100%)

Code review

54 tests

User reviews

42 reviews

Install metrics

10,000+ active /117,860 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▲4.16ms] Passed 4 tests

An overview of server-side resources used by Latest Post Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7744.37 ▲4.55
Dashboard /wp-admin4.09 ▲0.7953.67 ▲2.56
Posts /wp-admin/edit.php4.17 ▲0.8161.29 ▲14.24
Add New Post /wp-admin/post-new.php6.65 ▲0.7794.19 ▲2.59
Media Library /wp-admin/upload.php3.98 ▲0.7544.39 ▲6.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 55 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
lps_asset_version
db_upgraded
lps_plugin_notice_db_ver
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Latest Post Shortcode: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /7,394 ▲4,63213.68 ▼0.631.61 ▼0.2741.76 ▼3.08
Dashboard /wp-admin6,775 ▲4,5955.04 ▼0.65109.34 ▲21.14105.05 ▲65.96
Posts /wp-admin/edit.php6,696 ▲4,5962.37 ▲0.4244.96 ▲2.3272.76 ▲37.95
Add New Post /wp-admin/post-new.php10,763 ▲9,23719.06 ▼4.01946.53 ▲322.1840.18 ▼2.57
Media Library /wp-admin/upload.php5,923 ▲4,5324.32 ▲0.05101.72 ▲0.2691.31 ▲47.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • lps_plugin_notice_db_ver
    • lps_asset_version
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/latest-post-shortcode/elementor/widgets/class-lps-widgets.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/latest-post-shortcode/latest-post-shortcode.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Base_Data_Control' not found in wp-content/plugins/latest-post-shortcode/elementor/controls/class-lps-control.php:12

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: custom output, content shortcode, configurable shortcode with ui, paginated posts list, posts grid...

latest-post-shortcode/latest-post-shortcode.php 85% from 13 tests

The main file in "Latest Post Shortcode" v. 11.6.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 310 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin5,345 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP74748384,461
PO File1390446795
SVG30063
JSON20015
CSS7067
JavaScript4004

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 318)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity172.00
▷ Minimum class complexity1.00
▷ Maximum class complexity678.00
Average method complexity9.46
▷ Minimum method complexity1.00
▷ Maximum method complexity318.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods81
▷ Static methods6175.31%
▷ Public methods7693.83%
▷ Protected methods44.94%
▷ Private methods11.23%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants11
▷ Global constants436.36%
▷ Class constants763.64%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.46MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/post_tiles11.png26.45KB9.90KB▼ 62.57%
assets/images/post_tiles22.png29.36KB10.43KB▼ 64.47%
assets/images/post_tiles18.png29.06KB10.60KB▼ 63.54%
assets/images/post_tiles17.png29.21KB10.30KB▼ 64.73%
assets/images/icon-128x128.png8.50KB3.84KB▼ 54.83%