84% switch-last-posts-widget

Code Review | Switch Last Posts Widget

WordPress plugin Switch Last Posts Widget scored84%from 54 tests.

About plugin

  • Plugin page: switch-last-posts...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Oct 5, 2013
  • Latest release: Dec 11, 2013
  • Number of updates: 5
  • Update frequency: every 238.6 days
  • Top authors: LordPretender (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,144 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

A check of server-side resources used by Switch Last Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.09 ▲2.32
Dashboard /wp-admin3.32 ▼0.0350.06 ▼11.71
Posts /wp-admin/edit.php3.37 ▲0.0147.12 ▲1.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.44 ▼8.37
Media Library /wp-admin/upload.php3.24 ▲0.0133.61 ▼1.27

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_slpw_widget

Browser metrics Passed 4 tests

Switch Last Posts Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.131.76 ▲0.0544.31 ▲5.16
Dashboard /wp-admin2,209 ▲214.85 ▼1.0398.06 ▼6.4338.99 ▼1.57
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0639.63 ▼0.0536.20 ▲1.92
Add New Post /wp-admin/post-new.php1,514 ▼517.47 ▼5.94627.61 ▼41.8253.15 ▲1.89
Media Library /wp-admin/upload.php1,388 ▲34.27 ▲0.0196.37 ▼21.8343.59 ▼4.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_slpw_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/switch-last-posts-widget/switch-last-posts-widget.php:14

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 Passed 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
4 plugin tags: widget, recent posts, last posts, switch

switch-last-posts-widget/switch-last-posts-widget.php Passed 13 tests

"Switch Last Posts Widget" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
111 characters long description:
Thiw widget displays your recent posts according the current main category. Based on the "Recent Posts" widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin126 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP13666100
PO File1163326

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods00.00%
▷ Private methods233.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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