89% focus-slider

Code Review | Focus - Featured Posts Widget & Shortcode

WordPress plugin Focus - Featured Posts Widget & Shortcode scored89%from 54 tests.

About plugin

  • Plugin page: focus-slider
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.7
  • WordPress version: 6.3.1
  • First release: Sep 15, 2016
  • Latest release: Sep 15, 2016
  • Number of updates: 4
  • Update frequency: every 22.0 days
  • Top authors: phpbits (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /2,230 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.22MB] [CPU: ▼2.44ms] Passed 4 tests

Server-side resources used by Focus - Featured Posts Widget & Shortcode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2137.81 ▼5.44
Dashboard /wp-admin3.51 ▲0.2152.06 ▲1.39
Posts /wp-admin/edit.php3.63 ▲0.2751.64 ▼0.89
Add New Post /wp-admin/post-new.php6.13 ▲0.24101.96 ▼4.80
Media Library /wp-admin/upload.php3.44 ▲0.2141.12 ▲3.62
Getting started with Focus /wp-admin/index.php?page=focuswp-getting-started3.4034.73

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 36 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_focuswp_widget
widget_recent-comments
can_compress_scripts
focuswp_installDate
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Focus - Featured Posts Widget & Shortcode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,881 ▲12013.88 ▼0.757.81 ▲5.9843.09 ▲3.62
Dashboard /wp-admin2,204 ▲245.65 ▼0.0489.08 ▼7.6146.43 ▲1.31
Posts /wp-admin/edit.php2,112 ▲122.08 ▲0.0841.71 ▲4.4434.81 ▲4.59
Add New Post /wp-admin/post-new.php1,547 ▲719.09 ▲0.74660.80 ▲2.7956.45 ▲2.51
Media Library /wp-admin/upload.php1,403 ▲64.30 ▲0.09103.10 ▼1.2042.83 ▼0.50
Getting started with Focus /wp-admin/index.php?page=focuswp-getting-started1,3566.3059.1086.15

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • widget_focuswp_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • focuswp_installDate
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please add at least on tag
  • Screenshots: Add images for these screenshots: #1 (Widget Filter Options), #2 (Widget Slider Options), #3 (Media Frame Filter Options), #4 (Media Frame Slider Options), #5 (Focus Featured Post Slider)
The official readme.txt is a good inspiration

focus-slider/plugin.php 85% from 13 tests

The main PHP script in "Focus - Featured Posts Widget & Shortcode" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("focus-slider.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected1,894 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP9116133785
JavaScript89768600
Sass4148484
SVG19021
CSS4004

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity13.43
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods48
▷ Static methods12.08%
▷ Public methods48100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin