83% user-submitted-posts

Code Review | User Submitted Posts – Enable Users to Submit Posts from the Front End

WordPress plugin User Submitted Posts – Enable Users to Submit Posts from the Front End scored83%from 54 tests.

About plugin

  • Plugin page: user-submitted-posts
  • Plugin version: 20231102...
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 21, 2011
  • Latest release: Nov 3, 2023
  • Number of updates: 109
  • Update frequency: every 42.6 days
  • Top authors: specialk (100%)

Code review

54 tests

User reviews

886 reviews

Install metrics

20,000+ active /944,883 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.80MB] [CPU: ▼0.12ms] Passed 4 tests

A check of server-side resources used by User Submitted Posts – Enable Users to Submit Posts from the Front End
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8653.25 ▲15.68
Dashboard /wp-admin4.15 ▲0.8052.92 ▼9.16
Posts /wp-admin/edit.php4.20 ▲0.8447.58 ▲0.42
Add New Post /wp-admin/post-new.php6.67 ▲0.7885.51 ▼2.07
Media Library /wp-admin/upload.php4.01 ▲0.7841.12 ▲10.33
Submitted Posts /wp-admin/options-general.php?page=user-submitted-posts4.0246.03

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 114 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
usp_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
category_children
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

User Submitted Posts – Enable Users to Submit Posts from the Front End: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲11113.50 ▼0.7613.57 ▲11.5444.93 ▲1.61
Dashboard /wp-admin2,202 ▲285.60 ▼0.0997.55 ▲3.0443.58 ▲0.20
Posts /wp-admin/edit.php2,108 ▲81.99 ▼0.0235.99 ▼4.5232.85 ▼2.22
Add New Post /wp-admin/post-new.php1,529 ▲323.25 ▲0.22691.38 ▼29.1149.98 ▼7.02
Media Library /wp-admin/upload.php1,407 ▲74.18 ▼0.0394.05 ▼7.6640.82 ▼3.05
Submitted Posts /wp-admin/options-general.php?page=user-submitted-posts3,4983.1345.9697.63

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • category_children
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/user-submitted-posts/library/shortcode-access.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/user-submitted-posts/library/shortcode-misc.php:40
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/user-submitted-posts/recaptcha/ReCaptcha/RequestMethod/SocketPost.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/user-submitted-posts/recaptcha/ReCaptcha/RequestMethod/CurlPost.php:46
    • > PHP Fatal error
      Uncaught Error: Interface 'ReCaptcha\\RequestMethod' not found in wp-content/plugins/user-submitted-posts/recaptcha/ReCaptcha/RequestMethod/Post.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 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
10 plugin tags: frontend post, user post, share post, guest post, user submitted post...

user-submitted-posts/user-submitted-posts.php 85% from 13 tests

"User Submitted Posts – Enable Users to Submit Posts from the Front End" version 20231102...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "20231102...")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin28,419 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PO File2911,77413,10823,722
PHP252,1378824,316
JavaScript52537244
CSS34622137

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity5.78
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods36
▷ Static methods12.78%
▷ Public methods36100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions123
▷ Named functions12299.19%
▷ Anonymous functions10.81%
Constants18
▷ Global constants633.33%
▷ Class constants1266.67%
▷ Public constants12100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/usp-login-bg.png0.19KB0.19KB▼ 0.52%
images/usp-pro.png8.83KB4.74KB▼ 46.29%
(invalid) images/usp-login-bg-alt.png2.67KB0.00KB▼ 100.00%
resources/chosen-sprite@2x.png0.72KB0.83KB0.00%
resources/chosen-sprite.png0.53KB0.88KB0.00%