78% bp-site-post

Code Review | BP Site Post

WordPress plugin BP Site Post scored78%from 54 tests.

About plugin

  • Plugin page: bp-site-post
  • Plugin version: 1.7.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.1-5.6
  • WordPress version: 6.3.1
  • First release: Feb 28, 2019
  • Latest release: Jan 1, 2021
  • Number of updates: 35
  • Update frequency: every 19.3 days
  • Top authors: Venutius (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,386 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.03ms] Passed 4 tests

This is a short check of server-side resources used by BP Site Post
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.29 ▼0.01
Dashboard /wp-admin3.35 ▲0.0544.91 ▲0.07
Posts /wp-admin/edit.php3.47 ▲0.1147.01 ▲2.39
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.73 ▼10.12
Media Library /wp-admin/upload.php3.27 ▲0.0537.04 ▲1.96
BP Site Post /wp-admin/options-general.php?page=bp-site-post-settings3.7035.28

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_bpsp_site_post_widget
can_compress_scripts
bpsp_site_post_settings
widget_theysaidso_widget

Browser metrics Passed 4 tests

BP Site Post: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲12213.47 ▼0.818.70 ▲7.0841.59 ▲0.81
Dashboard /wp-admin2,202 ▲315.60 ▲0.0384.91 ▼4.7138.08 ▼2.85
Posts /wp-admin/edit.php2,101 ▼22.01 ▲0.0435.38 ▼12.4432.58 ▼9.52
Add New Post /wp-admin/post-new.php1,541 ▲1523.18 ▼0.12672.34 ▼18.8257.88 ▲6.50
Media Library /wp-admin/upload.php1,407 ▲74.19 ▲0.04102.57 ▲6.2351.35 ▲6.36
BP Site Post /wp-admin/options-general.php?page=bp-site-post-settings1,3712.0023.1030.41

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_bpsp_site_post_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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 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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/bp-site-post/templates/my-posts-moderation.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/bp-site-post/templates/my-posts-pending.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function bp_displayed_user_id() in wp-content/plugins/bp-site-post/templates/my-posts.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bp-site-post/inc/bpsp-widget.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=bp-site-post-settings
    • > Network (severe)
    wp-content/plugins/bp-site-post/views/images/bpsp-grey34x34.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Donate link: Invalid url: "paypal.me/GeorgeChaplin"
The official readme.txt is a good inspiration

bp-site-post/bp-site-post.php Passed 13 tests

The main PHP file in "BP Site Post" ver. 1.7.6 adds more information about the plugin and also serves as the entry point for this plugin
70 characters long description:
Write, publish and edit posts in the front end, BP Post Status enabled

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 plugin3,317 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP125354092,448
PO File1175187441
CSS2675351
JavaScript415677

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity65.50
▷ Minimum class complexity7.00
▷ Maximum class complexity124.00
Average method complexity4.22
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods40
▷ Static methods00.00%
▷ Public methods40100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions80
▷ Named functions7998.75%
▷ Anonymous functions11.25%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/accepted_48.png5.13KB1.89KB▼ 63.13%
img/cancel_48.png5.19KB1.92KB▼ 63.09%