78% legitimate-post-submitter

Code Review | Legitimate Post Submitter

WordPress plugin Legitimate Post Submitter scored78%from 54 tests.

About plugin

  • Plugin page: legitimate-post-s...
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8.3
  • WordPress version: 6.3.1
  • First release: Oct 12, 2020
  • Latest release: Jan 25, 2022
  • Number of updates: 11
  • Update frequency: every 43.1 days
  • Top authors: gerardlegitimate (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /435 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.59MB] [CPU: ▼15.76ms] Passed 4 tests

Analyzing server-side resources used by Legitimate Post Submitter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.45 ▼3.46
Dashboard /wp-admin3.40 ▲0.0946.99 ▼1.57
Posts /wp-admin/edit.php3.54 ▲0.1754.43 ▲6.49
Add New Post /wp-admin/post-new.php3.28 ▼2.6235.67 ▼62.23
Media Library /wp-admin/upload.php3.32 ▲0.0936.47 ▲4.22

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Legitimate Post Submitter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.39 ▲0.021.82 ▲0.2441.20 ▲4.43
Dashboard /wp-admin2,195 ▲175.60 ▼0.0981.41 ▼18.5439.32 ▼3.58
Posts /wp-admin/edit.php2,270 ▲1703.46 ▲1.4784.21 ▲45.9635.28 ▼0.22
Add New Post /wp-admin/post-new.php6,389 ▲4,86126.15 ▲2.97876.01 ▲198.3447.94 ▼20.26
Media Library /wp-admin/upload.php1,403 ▼04.21 ▲0.0379.89 ▼14.8341.18 ▼3.99

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/legitimate-post-submitter/legitimate.php
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant LEGITIMATE_AUTHOR_URL - assumed 'LEGITIMATE_AUTHOR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/views/backend/user/profile-fields.php on line 7
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_URL - assumed 'Legitimate_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/legitimate-post-submitter/views/backend/post/metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/legitimate-post-submitter/views/backend/user/profile-fields.php:7
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_URL - assumed 'Legitimate_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 14
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_PATH - assumed 'Legitimate_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 11
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_PATH - assumed 'Legitimate_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 12
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_URL - assumed 'Legitimate_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 15
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_PATH - assumed 'Legitimate_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 12
    • > PHP Warning
      Use of undefined constant Legitimate_PLUGIN_DIR_URL - assumed 'Legitimate_PLUGIN_DIR_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/legitimate-post-submitter/src/constants.php on line 15

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, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: fake news, misinformation, content, marketing, content sharing

legitimate-post-submitter/legitimate.php 92% from 13 tests

The principal PHP file in "Legitimate Post Submitter" v. 1.0.4 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("legitimate-post-submitter.php" instead of "legitimate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin802 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP20125170689
JavaScript14367
CSS10026
JSON10020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.78
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.84
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods39
▷ Static methods37.69%
▷ Public methods3897.44%
▷ Protected methods00.00%
▷ Private methods12.56%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants17
▷ Global constants1694.12%
▷ Class constants15.88%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin