63% user-post-collections

Code Review | User Post Collections

WordPress plugin User Post Collections scored63%from 54 tests.

About plugin

  • Plugin page: user-post-collect...
  • Plugin version: 0.8.32
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 10, 2022
  • Latest release: Jan 30, 2023
  • Number of updates: 7
  • Update frequency: every 24.9 days
  • Top authors: tauri77 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /578 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.61MB] [CPU: ▼1.31ms] Passed 4 tests

This is a short check of server-side resources used by User Post Collections
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2939.12 ▼1.08
Dashboard /wp-admin4.00 ▲0.7051.45 ▲1.76
Posts /wp-admin/edit.php4.12 ▲0.7655.40 ▼0.62
Add New Post /wp-admin/post-new.php6.68 ▲0.7998.71 ▼5.29
Media Library /wp-admin/upload.php3.92 ▲0.6943.21 ▲7.63
Settings /wp-admin/admin.php?page=mg_upc_settings3.8942.84
User Post Lists /wp-admin/admin.php?page=user-post-list3.8736.02

Server storage [IO: ▲0.60MB] [DB: ▲0.08MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 74 new files
Database: 3 new tables, 29 new options
New tables
wp_upc_lists
wp_upc_items
wp_upc_votes
New WordPress options
mg_upc_share_buttons
mg_upc_button_position
db_upgraded
mg_upc_single_page
mg_upc_type_vote
mg_upc_type_simple
mg_upc_texts
mg_upc_type_numbered
mg_upc_type_bookmarks
mg_upc_store_vote_anonymize_ip
...

Browser metrics Passed 4 tests

User Post Collections: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲19313.76 ▼0.6117.22 ▲15.4139.47 ▼0.90
Dashboard /wp-admin2,230 ▲525.75 ▲0.0496.40 ▼5.1042.40 ▼6.92
Posts /wp-admin/edit.php2,135 ▲352.08 ▲0.0541.77 ▲4.0833.91 ▼4.35
Add New Post /wp-admin/post-new.php1,554 ▲1323.42 ▲5.30671.16 ▲45.3259.13 ▼1.68
Media Library /wp-admin/upload.php1,435 ▲384.26 ▲0.05111.14 ▲5.0446.18 ▼1.28
Settings /wp-admin/admin.php?page=mg_upc_settings2,6682.0135.1930.15
User Post Lists /wp-admin/admin.php?page=user-post-list9552.1735.3830.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 3 tables
    • wp_upc_votes
    • wp_upc_lists
    • wp_upc_items
  • This plugin does not fully uninstall, leaving 29 options in the database
    • mg_upc_flush_rewrite
    • theysaidso_admin_options
    • can_compress_scripts
    • mg_upc_purge_on_uninstall
    • mg_upc_ajax_load
    • widget_recent-posts
    • mg_upc_post_stats
    • mg_upc_single_page_mode
    • mg_upc_single_title
    • mg_upc_type_favorites
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/user-post-collections/includes/mg-upc-settings-api.php
    • > /wp-content/plugins/user-post-collections/includes/admin-notice-helper/admin-notice-helper.php
    • > /wp-content/plugins/user-post-collections/user-post-collections.php
  • 32× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MG_UPC_Module' not found in wp-content/plugins/user-post-collections/classes/mg-upc-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-post-collections/includes/template-hooks.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/user-post-collections/templates/single-mg-upc/item/image.php:13
    • > PHP Warning
      Use of undefined constant MG_UPC_REQUIRED_WP_VERSION - assumed 'MG_UPC_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/user-post-collections/templates/requirements-error.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mg_upc_list_check_support() in wp-content/plugins/user-post-collections/templates/single-mg-upc/item/actions/add-to-cart.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MG_UPC_Module' not found in wp-content/plugins/user-post-collections/controllers/mg-upc-buttons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/user-post-collections/templates/single-mg-upc/item/position-number.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'MG_UPC_Module' not found in wp-content/plugins/user-post-collections/controllers/mg-list-page-alt.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/user-post-collections/templates/single-mg-upc/sharing.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/user-post-collections/templates/shortcode-404.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=mg_upc_settings
    • > Javascript (severe) in unknown
    /wp-content/plugins/user-post-collections/javascript/mg-upc-client/dist/admin.js?ver=0.8.32 0:8256 Uncaught TypeError: Cannot read properties of null (reading '__k')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: user lists, post collections, woocommerce wishlist

user-post-collections/user-post-collections.php Passed 13 tests

The entry point to "User Post Collections" version 0.8.32 is a PHP file that has certain tags in its header comment area
46 characters long description:
Allows users to create their post collections.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin9,648 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
PHP591,7592,7379,299
JavaScript41415184
CSS3110119
SVG10027
Markdown17019

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity44.50
▷ Minimum class complexity1.00
▷ Maximum class complexity216.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes00.00%
Methods368
▷ Static methods4612.50%
▷ Public methods33089.67%
▷ Protected methods92.45%
▷ Private methods297.88%
Functions67
▷ Named functions3552.24%
▷ Anonymous functions3247.76%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
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
images/blank.png0.27KB0.10KB▼ 61.68%