89% custom-latest-posts-widget

Code Review | Custom latest posts widget

WordPress plugin Custom latest posts widget scored 89% from 54 tests.

About plugin

  • Plugin page: custom-latest-pos...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 5.8.1
  • First release: Dec 15, 2017
  • Latest release: Dec 15, 2017
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: Er.sunil (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 472 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Custom latest posts widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0534.47 ▼0.41
Dashboard /wp-admin3.10 ▲0.0542.90 ▼4.51
Posts /wp-admin/edit.php3.16 ▲0.0543.87 ▼3.32
Add New Post /wp-admin/post-new.php5.46 ▲0.0391.67 ▼560.59
Media Library /wp-admin/upload.php3.05 ▲0.0532.01 ▼0.60

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 1 new option
New WordPress options
widget_custom_lpw_latest_posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom latest posts widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,681 ▲8515.84 ▲0.398.43 ▼0.4050.56 ▲0.35
Dashboard /wp-admin2,967 ▲335.87 ▼0.19139.35 ▼13.85113.10 ▼5.91
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0162.75 ▼5.8692.08 ▼2.65
Add New Post /wp-admin/post-new.php1,500 ▼19118.53 ▼0.64359.57 ▼11.66109.89 ▼4.86
Media Library /wp-admin/upload.php1,804 ▼35.01 ▲0.01151.03 ▼4.95120.26 ▲0.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_custom_lpw_latest_posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The SRP test was a success

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

readme.txt 88% from 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
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
  • Stable tag: Not defined
You can look at the official readme.txt

custom-latest-posts-widget/custom-latest-posts-widget.php Passed 13 tests

Analyzing the main PHP file in "Custom latest posts widget" version 1.0
64 characters long description:
Latest posts widget to display recent posts with post thumbnail.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected226 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17029207
CSS13119

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity9.75
▷ Minimum method complexity1.00
▷ Maximum method complexity20.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%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin