79% custom-post-limits

Code Review | Custom Post Limits

WordPress plugin Custom Post Limits scored 79% from 54 tests.

About plugin

  • Plugin page: custom-post-limits
  • Plugin version: 4.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 6.3.1
  • First release: Jul 16, 2009
  • Latest release: Apr 14, 2021
  • Number of updates: 19
  • Update frequency: every 228.4 days
  • Top authors: coffee2code (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

2,000+ active / 56,955 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
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▲3.49ms] Passed 4 tests

Analyzing server-side resources used by Custom Post Limits
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3246.09 ▲1.68
Dashboard /wp-admin3.67 ▲0.3677.80 ▲18.86
Posts /wp-admin/edit.php3.72 ▲0.3657.13 ▲3.63
Add New Post /wp-admin/post-new.php6.19 ▲0.3096.56 ▲0.81
Media Library /wp-admin/upload.php3.53 ▲0.3042.35 ▲7.82
Post Limits /wp-admin/options-general.php?page=custom-post-limits/custom-post-limits.php3.5545.88

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Custom Post Limits
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲1813.24 ▼1.564.62 ▲2.3540.38 ▼5.70
Dashboard /wp-admin2,210 ▲15.88 ▼0.01112.18 ▲1.7543.10 ▼0.14
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0236.39 ▲1.4332.78 ▼1.80
Add New Post /wp-admin/post-new.php1,536 ▲2223.36 ▲5.79713.68 ▲8.6851.33 ▼5.67
Media Library /wp-admin/upload.php1,389 ▲44.18 ▲0.06101.80 ▼8.2944.19 ▲0.29
Post Limits /wp-admin/options-general.php?page=custom-post-limits/custom-post-limits.php1,1411.6829.2053.56

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/custom-post-limits/tests/bootstrap.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-post-limits/tests/bootstrap.php on line 17
    • > PHP Warning
      require_once(/tmp/wordpress-tests-lib/tests/phpunit/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/custom-post-limits/tests/bootstrap.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: tags, listing, archives, front page, query...

custom-post-limits/custom-post-limits.php Passed 13 tests

"Custom Post Limits" version 4.4.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
118 characters long description:
Independently control the number of posts listed on the front page, author/category/tag archives, search results, etc.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,875 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP65648182,514
Markdown3540326
Bourne Shell16221
XML10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity87.75
▷ Minimum class complexity3.00
▷ Maximum class complexity177.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes133.33%
Methods171
▷ Static methods84.68%
▷ Public methods15791.81%
▷ Protected methods148.19%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
c2c_minilogo.png3.49KB1.91KB▼ 45.43%