84% latest-posts-template-widget

Code Review | Latest Posts Template Widget

WordPress plugin Latest Posts Template Widget scored84%from 54 tests.

About plugin

  • Plugin page: latest-posts-temp...
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.3.1
  • WordPress version: 6.3.1
  • First release: Jun 6, 2014
  • Latest release: Nov 23, 2015
  • Number of updates: 9
  • Update frequency: every 59.6 days
  • Top authors: inc2734 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,484 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.77ms] Passed 4 tests

A check of server-side resources used by Latest Posts Template Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0439.35 ▲3.40
Dashboard /wp-admin3.35 ▼0.0049.23 ▼14.87
Posts /wp-admin/edit.php3.40 ▲0.0449.41 ▲1.97
Add New Post /wp-admin/post-new.php5.93 ▲0.0480.52 ▼25.58
Media Library /wp-admin/upload.php3.27 ▲0.0438.37 ▲7.29

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_lptw
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Latest Posts Template Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.60 ▼0.775.06 ▲3.4444.85 ▲3.82
Dashboard /wp-admin2,206 ▲155.90 ▲0.99114.79 ▲11.7642.13 ▲1.35
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0533.30 ▼7.5234.00 ▼3.90
Add New Post /wp-admin/post-new.php1,533 ▲1923.04 ▲5.34631.14 ▲1.0151.63 ▲0.20
Media Library /wp-admin/upload.php1,391 ▲34.22 ▼0.0594.71 ▲1.7542.11 ▼1.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_lptw
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/latest-posts-template-widget/latest-posts-template-widget.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/latest-posts-template-widget/system/widget.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

latest-posts-template-widget/latest-posts-template-widget.php 92% from 13 tests

Analyzing the main PHP file in "Latest Posts Template Widget" version 0.4
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin213 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21766167
PO File1121446

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity6.50
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods218.18%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected