84% codeflavors-featured-post

Code Review | CodeFlavors Featured Post

WordPress plugin CodeFlavors Featured Post scored 84% from 54 tests.

About plugin

  • Plugin page: codeflavors-featu...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 5.8.1
  • First release: Jan 26, 2016
  • Latest release: Aug 22, 2016
  • Number of updates: 21
  • Update frequency: every 15.2 days
  • Top authors: codeflavors (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 2,550 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▼147.87ms] Passed 4 tests

This is a short check of server-side resources used by CodeFlavors Featured Post
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2538.03 ▲14.04
Dashboard /wp-admin3.30 ▲0.2550.83 ▼2.51
Posts /wp-admin/edit.php3.35 ▲0.2449.66 ▼1.28
Add New Post /wp-admin/post-new.php5.60 ▲0.1794.38 ▼591.72
Media Library /wp-admin/upload.php3.18 ▲0.1837.36 ▲4.02
Featured Post by CodeFlavors /wp-admin/themes.php?page=cfp-options3.1531.69
About CodeFlavors Featured Post /wp-admin/admin.php?page=cfp-about3.1631.15

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 1 new option
New WordPress options
widget_cfp-widget

Browser metrics Passed 4 tests

A check of browser resources used by CodeFlavors Featured Post
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,844 ▲24816.33 ▲0.4715.73 ▲6.0149.16 ▲1.19
Dashboard /wp-admin2,978 ▲445.89 ▼0.18138.44 ▼21.03118.52 ▲0.31
Posts /wp-admin/edit.php2,744 ▲82.68 ▼0.0169.31 ▲1.6196.88 ▲1.26
Add New Post /wp-admin/post-new.php1,501 ▼18218.82 ▲0.48403.83 ▲24.58112.11 ▲0.40
Media Library /wp-admin/upload.php1,812 ▲55.02 ▼0.02153.28 ▼10.73126.82 ▲3.40
Featured Post by CodeFlavors /wp-admin/themes.php?page=cfp-options1,2002.0861.9782.95
About CodeFlavors Featured Post /wp-admin/admin.php?page=cfp-about1,1162.0657.81124.97

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 detected upon uninstall: 1 option
    • widget_cfp-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/codeflavors-featured-post/includes/compatibility.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/codeflavors-featured-post/views/plugin_options.template.php: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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

codeflavors-featured-post/index.php 92% from 13 tests

The main PHP file in "CodeFlavors Featured Post" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("codeflavors-featured-post.php" instead of "index.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 detected1,678 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP101893831,103
PO File2130156392
JavaScript11912151
CSS24332

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.33
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes120.00%
Methods34
▷ Static methods926.47%
▷ Public methods2985.29%
▷ Protected methods25.88%
▷ Private methods38.82%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/featured.png1.17KB0.87KB▼ 25.75%
assets/admin/js/tinymce/featured_post/ico.png0.43KB0.39KB▼ 8.94%