78% wp-featured-posts

Code Review | WP Featured Posts

WordPress plugin WP Featured Posts scored78%from 54 tests.

About plugin

  • Plugin page: wp-featured-posts
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 16, 2020
  • Latest release: Jan 6, 2023
  • Number of updates: 15
  • Update frequency: every 56.1 days
  • Top authors: nutttaro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /1,838 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
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.07ms] Passed 4 tests

This is a short check of server-side resources used by WP Featured Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.94 ▼3.33
Dashboard /wp-admin3.43 ▲0.1249.51 ▼1.30
Posts /wp-admin/edit.php3.54 ▲0.1852.95 ▼0.79
Add New Post /wp-admin/post-new.php6.01 ▲0.1287.19 ▼22.44
Media Library /wp-admin/upload.php3.35 ▲0.1238.90 ▼1.20

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WP Featured Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,862 ▲10113.66 ▼0.724.71 ▲2.9940.27 ▼4.67
Dashboard /wp-admin2,268 ▲624.91 ▲0.0598.16 ▼10.0137.07 ▼10.84
Posts /wp-admin/edit.php2,151 ▲482.07 ▲0.0936.75 ▲1.0736.21 ▼0.09
Add New Post /wp-admin/post-new.php1,548 ▲1723.22 ▲0.10630.32 ▼57.0951.53 ▼7.28
Media Library /wp-admin/upload.php1,450 ▲504.23 ▼0.01103.02 ▼5.3648.15 ▲1.96

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-featured-posts/templates/featured-posts.php
  • 4× 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/wp-featured-posts/wp-featured-posts.php:19
    • > PHP Notice
      Undefined variable: featured_posts in wp-content/plugins/wp-featured-posts/templates/featured-posts.php on line 39
    • > PHP Notice
      Undefined variable: show_select_post in wp-content/plugins/wp-featured-posts/templates/featured-posts.php on line 5
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/wp-featured-posts/templates/featured-posts.php on line 2

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)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention: The official readme.txt might help

wp-featured-posts/wp-featured-posts.php Passed 13 tests

The principal PHP file in "WP Featured Posts" v. 1.0.7 is loaded by WordPress automatically on each request
79 characters long description:
Set featured posts, sortable and sticky custom post type. Compatible with WPML.

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
Good job! No executable or dangerous file extensions detected901 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP5166165717
JavaScript4395129
CSS20055

PHP code Passed 2 tests

A short review of 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.40
Average class complexity30.67
▷ Minimum class complexity6.00
▷ Maximum class complexity77.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods310.00%
▷ Public methods2893.33%
▷ Protected methods13.33%
▷ Private methods13.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin