84% custom-posts-per-page

Code Review | Custom Posts Per Page

WordPress plugin Custom Posts Per Page scored84%from 54 tests.

About plugin

  • Plugin page: custom-posts-per-...
  • Plugin version: 1.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2011
  • Latest release: Dec 11, 2014
  • Number of updates: 47
  • Update frequency: every 24.7 days
  • Top authors: jeremyfelt (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

1,000+ active /35,429 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼3.10ms] Passed 4 tests

Server-side resources used by Custom Posts Per Page
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.52 ▲0.88
Dashboard /wp-admin3.41 ▲0.1051.29 ▼2.57
Posts /wp-admin/edit.php3.52 ▲0.1652.05 ▼0.75
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.38 ▼8.51
Media Library /wp-admin/upload.php3.33 ▲0.1037.58 ▼0.57
Posts Per Page /wp-admin/options-general.php?page=post-count-settings3.2929.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
cpppc_upgrade
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
cpppc_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Posts Per Page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.29 ▼1.004.77 ▲3.1042.57 ▲1.68
Dashboard /wp-admin2,207 ▲285.83 ▼0.1097.01 ▼6.4338.43 ▼7.48
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0538.98 ▼2.8534.44 ▼0.94
Add New Post /wp-admin/post-new.php1,540 ▲2123.09 ▼0.03613.29 ▼11.1653.38 ▼4.58
Media Library /wp-admin/upload.php1,386 ▼24.18 ▼0.07101.16 ▼10.8642.56 ▼5.59
Posts Per Page /wp-admin/options-general.php?page=post-count-settings9412.1825.0444.65

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/custom-posts-per-page/custom-posts-per-page.php:71

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
10 plugin tags: posts-per-page, settings, admin, posts, number...

custom-posts-per-page/custom-posts-per-page.php Passed 13 tests

The main PHP file in "Custom Posts Per Page" ver. 1.7.1 adds more information about the plugin and also serves as the entry point for this plugin
78 characters long description:
Shows a custom set number of posts depending on the type of page being viewed.

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 plugin281 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP276179281

PHP code Passed 2 tests

A brief analysis 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.27
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods22100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected