84% custom-post-type-sticky

Code Review | Custom Post Type Sticky

WordPress plugin Custom Post Type Sticky scored 84% from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Aug 5, 2017
  • Latest release: Sep 1, 2020
  • Number of updates: 7
  • Update frequency: every 160.4 days
  • Top authors: Abhay Raj (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active / 15,545 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.51ms] Passed 4 tests

Server-side resources used by Custom Post Type Sticky
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.04 ▲5.03
Dashboard /wp-admin3.32 ▲0.0248.46 ▼2.24
Posts /wp-admin/edit.php3.37 ▲0.0147.16 ▼2.23
Add New Post /wp-admin/post-new.php5.90 ▲0.01115.57 ▲19.27
Media Library /wp-admin/upload.php3.24 ▲0.0133.30 ▼2.61

Server storage [IO: ▲0.10MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for Custom Post Type Sticky
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.151.61 ▼0.1641.97 ▼2.54
Dashboard /wp-admin2,206 ▲184.89 ▼1.08122.23 ▲5.6046.63 ▼3.33
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0536.09 ▼2.6333.30 ▼2.56
Add New Post /wp-admin/post-new.php1,411 ▼12617.91 ▼5.19628.89 ▼51.9054.13 ▲1.02
Media Library /wp-admin/upload.php1,388 ▼34.22 ▼0.0499.05 ▼5.8242.73 ▼4.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-type-sticky/custom-post-type-sticky.php:17

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (screenshot-2.jpg) image missing
You can look at the official readme.txt

custom-post-type-sticky/custom-post-type-sticky.php 92% from 13 tests

"Custom Post Type Sticky" version 1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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 detected142 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PO File2181867
PHP1111642
JavaScript210633

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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.09MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png63.82KB22.87KB▼ 64.17%
screenshot-2.png26.46KB9.62KB▼ 63.63%