77% users-custom-posts-counts

Code Review | Users Custom Posts Counts

WordPress plugin Users Custom Posts Counts scored77%from 54 tests.

About plugin

  • Plugin page: users-custom-post...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Mar 17, 2011
  • Latest release: Apr 13, 2016
  • Number of updates: 15
  • Update frequency: every 123.7 days
  • Top authors: SebeT (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,736 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▲222.85ms] 75% from 4 tests

This is a short check of server-side resources used by Users Custom Posts Counts
Please have a look at the following items
  • Extra CPU: Extra CPU usage should be kept under 200.00ms (currently 222.85ms on /wp-admin/admin.php?page=ucpc_bc_about)
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.11 ▼5.58
Dashboard /wp-admin3.40 ▲0.06294.90 ▲235.55
Posts /wp-admin/edit.php3.53 ▲0.17290.65 ▲252.54
Add New Post /wp-admin/post-new.php5.65 ▼0.24505.54 ▲408.88
Media Library /wp-admin/upload.php3.46 ▲0.23456.79 ▲424.83
Users CPC Count /wp-admin/admin.php?page=users-cpc-counts3.37282.36
About /wp-admin/admin.php?page=ucpc_bc_about3.38272.37

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
recovery_mode_email_last_sent
can_compress_scripts
ucpc_options

Browser metrics Passed 4 tests

Checking browser requirements for Users Custom Posts Counts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.38 ▼0.241.77 ▲0.1950.76 ▲4.64
Dashboard /wp-admin2,225 ▲485.59 ▼0.0681.41 ▼23.2440.33 ▼5.84
Posts /wp-admin/edit.php2,127 ▲272.00 ▲0.0532.80 ▼7.6234.27 ▼1.53
Add New Post /wp-admin/post-new.php1,548 ▲1123.39 ▲5.16685.06 ▲43.7653.82 ▼6.07
Media Library /wp-admin/upload.php1,424 ▲274.19 ▲0.0393.84 ▼14.1645.98 ▲4.82
Users CPC Count /wp-admin/admin.php?page=users-cpc-counts8291.9930.8426.81
About /wp-admin/admin.php?page=ucpc_bc_about8121.516.2923.28

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • ucpc_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > Warning in wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php+237
    SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > Warning in wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php+237
    SimpleXMLElement::__construct(): 404 Not Found
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > Warning in wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php+237
    SimpleXMLElement::__construct(): ^
    • > GET request to /wp-admin/admin.php?page=ucpc_bc_about
    • > Error in wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php+237
    Uncaught Exception: String could not be parsed as XML in wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php:237
    Stack trace:
    #0 wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php(237): SimpleXMLElement->__construct()
    #1 wp-content/plugins/users-custom-posts-counts/admin/about/class-bc-about.php(221): BC_About_Page->products_output()
    #2 wp-content/plugins/users-custom-posts-counts/admin/about/BoxesPage.php(292): BC_About_Page->products_box()
    #3 wp-admin/includes/template.php(1443): scbBoxesPage->_intermediate_callback()
    #4 wp-content/plugins/users-custom-posts-counts/admin/about/BoxesPage.php(139): do_meta_boxes()
    #5 wp-content/plugins/users-custom-posts-counts/admin/about/AdminPage.php(565): scbBoxesPage->page_content()
    #6 wp-includes/class-wp-hook.php(310): scbAdminPage->_page_content_hook()
    #7 /var/www/wordpr

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'scbAdminPage' not found in wp-content/plugins/users-custom-posts-counts/admin/about/BoxesPage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/users-custom-posts-counts/users-custom-posts-count.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === users-custom-posts-counts === )
The official readme.txt might help

users-custom-posts-counts/users-custom-posts-count.php 85% from 13 tests

"Users Custom Posts Counts" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("users-custom-posts-counts.php" instead of "users-custom-posts-count.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 179 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,168 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP53386781,077
CSS122191

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity23.00
▷ Minimum class complexity8.00
▷ Maximum class complexity34.00
Average method complexity2.26
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes250.00%
▷ Concrete classes250.00%
▷ Final classes00.00%
Methods71
▷ Static methods1926.76%
▷ Public methods5780.28%
▷ Protected methods1115.49%
▷ Private methods34.23%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin