84% sticky-cpt

Code Review | Sticky CPT

WordPress plugin Sticky CPT scored84%from 54 tests.

About plugin

  • Plugin page: sticky-cpt
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.3.2
  • WordPress version: 6.3.1
  • First release: Oct 23, 2016
  • Latest release: Mar 19, 2020
  • Number of updates: 12
  • Update frequency: every 103.6 days
  • Top authors: leprincenoir (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /3,003 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 gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.30ms] Passed 4 tests

Analyzing server-side resources used by Sticky CPT
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.11 ▼4.95
Dashboard /wp-admin3.36 ▲0.0646.59 ▼3.30
Posts /wp-admin/edit.php3.48 ▲0.1250.63 ▼4.38
Add New Post /wp-admin/post-new.php5.95 ▲0.0692.17 ▼8.55
Media Library /wp-admin/upload.php3.29 ▲0.0638.72 ▼0.07

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Sticky CPT
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.081.53 ▼0.3542.13 ▼5.73
Dashboard /wp-admin2,198 ▲185.61 ▼0.0682.81 ▼5.9039.96 ▲0.64
Posts /wp-admin/edit.php2,100 ▼01.99 ▲0.0139.27 ▼0.3136.28 ▼1.25
Add New Post /wp-admin/post-new.php1,529 ▼823.06 ▼0.08641.50 ▼15.6954.09 ▲6.17
Media Library /wp-admin/upload.php1,403 ▲34.27 ▲0.09100.40 ▼3.8043.03 ▼1.71

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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 fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sticky-cpt/sticky-cpt.php
    • > /wp-content/plugins/sticky-cpt/includes/class-sticky-cpt-loader.php
    • > /wp-content/plugins/sticky-cpt/includes/class-sticky-cpt-posts.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: cpt, forward, sticky, push, highlighting

sticky-cpt/sticky-cpt.php Passed 13 tests

Analyzing the main PHP file in "Sticky CPT" version 2.0.0
61 characters long description:
Add the possibility of "sticky" CPT (Gutenberg compatibility)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin268 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP311813252
JavaScript24116

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity13.00
▷ Minimum class complexity2.00
▷ Maximum class complexity30.00
Average method complexity2.80
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods419.05%
▷ Public methods1885.71%
▷ Protected methods00.00%
▷ Private methods314.29%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants4100.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
There were not PNG files found in your plugin