84% submit-content

Code Review | Submit Content

WordPress plugin Submit Content scored84%from 54 tests.

About plugin

  • Plugin page: submit-content
  • Plugin version: 1.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2.2
  • WordPress version: 6.3.1
  • First release: Sep 7, 2021
  • Latest release: Jun 23, 2023
  • Number of updates: 48
  • Update frequency: every 13.6 days
  • Top authors: bharatthapa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /527 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.27MB] [CPU: ▼1.39ms] Passed 4 tests

This is a short check of server-side resources used by Submit Content
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2640.50 ▼5.00
Dashboard /wp-admin3.57 ▲0.2752.41 ▲3.47
Posts /wp-admin/edit.php3.69 ▲0.3355.12 ▲6.38
Add New Post /wp-admin/post-new.php6.15 ▲0.27101.13 ▼6.63
Media Library /wp-admin/upload.php3.50 ▲0.2739.65 ▲2.59
Submit Content /wp-admin/admin.php?page=submitcontent3.4634.06
Form Settings /wp-admin/admin.php?page=sc-form-settings3.4634.42
Shortcodes /wp-admin/admin.php?page=sc-shortcodes3.4635.66

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 25 new files
Database: 1 new table, 7 new options
New tables
wp_submitcontent
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
submitcontent_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Submit Content: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲12013.38 ▼0.908.43 ▲6.5340.46 ▼1.87
Dashboard /wp-admin2,229 ▲525.58 ▼0.0384.19 ▼3.9341.21 ▼5.70
Posts /wp-admin/edit.php2,131 ▲311.97 ▲0.0339.53 ▲3.0835.98 ▼0.08
Add New Post /wp-admin/post-new.php1,551 ▲2523.32 ▲0.10672.38 ▼4.0256.53 ▲6.08
Media Library /wp-admin/upload.php1,428 ▲284.22 ▼0.01106.10 ▼0.5045.72 ▼0.29
Submit Content /wp-admin/admin.php?page=submitcontent1,0132.1627.4633.27
Form Settings /wp-admin/admin.php?page=sc-form-settings1,0052.2225.1527.10
Shortcodes /wp-admin/admin.php?page=sc-shortcodes8312.0627.9832.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 12× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/submit-content/deactivate.php
    • > /wp-content/plugins/submit-content/library/shortcode.php
    • > /wp-content/plugins/submit-content/uninstall.php
    • > /wp-content/plugins/submit-content/admin_assets/enqueue.php
    • > /wp-content/plugins/submit-content/submitcontent.php
    • > /wp-content/plugins/submit-content/library/utility_functions.php
    • > /wp-content/plugins/submit-content/activate.php
    • > /wp-content/plugins/submit-content/library/ajax.php
    • > /wp-content/plugins/submit-content/public_assets/enqueue.php
    • > /wp-content/plugins/submit-content/library/menu/settings.php

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: frontend post, public post, submit custom post, visitor post, submit post...

submit-content/submitcontent.php 92% from 13 tests

"Submit Content" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("submit-content.php" instead of "submitcontent.php")

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
Everything looks great! No dangerous files found in this plugin2,177 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP132522761,525
Markdown1800320
JavaScript22015272
CSS210060

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected