10% smart-posts-widget

Code Review | Smart Posts Widget

WordPress plugin Smart Posts Widget scored10%from 54 tests.

About plugin

  • Plugin page: smart-posts-widget
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Oct 29, 2014
  • Latest release: Apr 28, 2016
  • Number of updates: 15
  • Update frequency: every 36.5 days
  • Top authors: purab (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /5,406 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/smart-posts-widget/smart-posts.php+34
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartPosts has a deprecated constructor

Server metrics [RAM: ▼1.77MB] [CPU: ▼53.35ms] Passed 4 tests

Analyzing server-side resources used by Smart Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.255.11 ▼37.84
Dashboard /wp-admin2.24 ▼1.076.94 ▼43.11
Posts /wp-admin/edit.php2.24 ▼1.126.35 ▼42.84
Add New Post /wp-admin/post-new.php2.24 ▼3.657.52 ▼89.59
Media Library /wp-admin/upload.php2.24 ▼0.996.23 ▼30.12

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_smart-posts

Browser metrics Passed 4 tests

Checking browser requirements for Smart Posts Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.37 ▲0.021.99 ▼0.1744.60 ▲1.54
Dashboard /wp-admin2,199 ▲225.60 ▲0.0287.62 ▼6.7540.42 ▼3.11
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0235.78 ▲0.4435.38 ▲0.54
Add New Post /wp-admin/post-new.php1,530 ▲423.16 ▼0.31688.25 ▼16.6474.49 ▲18.18
Media Library /wp-admin/upload.php1,404 ▲44.15 ▼0.00108.81 ▼3.4045.98 ▼4.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 without warnings or errors
    • > Deprecated in wp-content/plugins/smart-posts-widget/smart-posts.php+34
    Methods with the same name as their class will not be constructors in a future version of PHP; SmartPosts has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_smart-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 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 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: There are too many tags (23 tag instead of maximum 10)
  • Screenshots: Please add images for these screenshots: #1 (Admin Widget configuration Section.), #2 (UI on your website widget any WordPress Theme.)
You can look at the official readme.txt

smart-posts-widget/smart-posts.php 92% from 13 tests

The entry point to "Smart Posts Widget" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("smart-posts-widget.php" instead of "smart-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected396 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP15933329
CSS231249
JavaScript11718

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity8.25
▷ Minimum method complexity1.00
▷ Maximum method complexity23.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%
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
2 PNG files occupy 0.40MB with 0.26MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png38.27KB14.83KB▼ 61.26%
screenshot-2.png373.75KB122.60KB▼ 67.20%