83% sb-latest-posts

Code Review | SB Latest Posts

WordPress plugin SB Latest Posts scored83%from 54 tests.

About plugin

  • Plugin page: sb-latest-posts
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 20, 2018
  • Latest release: Nov 22, 2018
  • Number of updates: 21
  • Update frequency: every 0.1 days
  • Top authors: Tajul2010 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /492 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.41ms] Passed 4 tests

An overview of server-side resources used by SB Latest Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.15 ▼5.96
Dashboard /wp-admin3.32 ▲0.0249.10 ▼5.22
Posts /wp-admin/edit.php3.37 ▲0.0148.39 ▼2.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.75 ▼8.45
Media Library /wp-admin/upload.php3.24 ▲0.0138.71 ▲0.50

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

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

Browser metrics Passed 4 tests

A check of browser resources used by SB Latest Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲13413.40 ▼0.898.29 ▲6.3240.96 ▼3.58
Dashboard /wp-admin2,217 ▲375.65 ▲0.0195.29 ▲4.7644.10 ▼0.27
Posts /wp-admin/edit.php2,122 ▲252.01 ▼0.0239.13 ▲0.9634.37 ▼2.18
Add New Post /wp-admin/post-new.php1,552 ▲2618.40 ▼5.16624.20 ▼78.6265.45 ▲7.12
Media Library /wp-admin/upload.php1,419 ▲164.18 ▼0.0697.51 ▼10.4443.17 ▼1.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_spellbit-latest-posts
    • db_upgraded
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sb-latest-posts/spellbit-latest-posts.php

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

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI found ("spellbit.com")
The official readme.txt is a good inspiration

sb-latest-posts/spellbit-latest-posts.php 85% from 13 tests

The main PHP script in "SB Latest Posts" version 1.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sb-latest-posts.php" instead of "spellbit-latest-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected370 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP211041253
CSS1171117

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity6.33
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/widget_1.png72.64KB36.32KB▼ 49.99%
images/shortcode-1.png37.04KB18.00KB▼ 51.40%
images/widget_2.png38.20KB18.39KB▼ 51.85%
images/widget_3.png13.62KB6.99KB▼ 48.69%