84% cpt-on-front-page

Code Review | CPT on Front Page

WordPress plugin CPT on Front Page scored84%from 54 tests.

About plugin

  • Plugin page: cpt-on-front-page
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 24, 2014
  • Latest release: Mar 24, 2014
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: fabrizim (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

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

Server-side resources used by CPT on Front Page
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.57 ▼6.76
Dashboard /wp-admin3.34 ▲0.0446.04 ▼3.46
Posts /wp-admin/edit.php3.39 ▲0.0450.31 ▲2.12
Add New Post /wp-admin/post-new.php5.92 ▲0.0492.15 ▼7.60
Media Library /wp-admin/upload.php3.26 ▲0.0335.52 ▼1.10

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by CPT on Front Page
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.15 ▼1.474.69 ▲2.9440.07 ▼3.84
Dashboard /wp-admin2,209 ▲214.86 ▼1.03107.15 ▼4.4042.03 ▼1.36
Posts /wp-admin/edit.php2,089 ▲32.00 ▼0.0439.82 ▲4.0134.73 ▼1.34
Add New Post /wp-admin/post-new.php1,542 ▲318.54 ▲0.02613.83 ▼21.7751.38 ▼13.05
Media Library /wp-admin/upload.php1,388 ▼34.20 ▲0.0598.92 ▲2.5543.66 ▲0.78

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cpt-on-front-page/plugin.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: front page, custom post types

cpt-on-front-page/plugin.php 85% from 13 tests

The main PHP file in "CPT on Front Page" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cpt-on-front-page.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected111 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13434111

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin