83% bp-moderation

Code Review | BuddyPress Moderation

WordPress plugin BuddyPress Moderation scored83%from 54 tests.

About plugin

  • Plugin page: bp-moderation
  • Plugin version: 0.1.7
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 2, 2010
  • Latest release: Nov 18, 2014
  • Number of updates: 52
  • Update frequency: every 32.0 days
  • Top authors: francescolaffi (96.15%)saurabhshukla (5.77%)

Code review

54 tests

User reviews

9 reviews

Install metrics

30+ active /25,610 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.37ms] Passed 4 tests

An overview of server-side resources used by BuddyPress Moderation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.00 ▼2.44
Dashboard /wp-admin3.31 ▼0.0344.53 ▼20.26
Posts /wp-admin/edit.php3.36 ▲0.0144.00 ▼4.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.76 ▼6.76
Media Library /wp-admin/upload.php3.23 ▲0.0132.63 ▼2.15

Server storage [IO: ▲0.17MB] [DB: ▲0.31MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for BuddyPress Moderation
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.061.67 ▼0.4243.79 ▲0.68
Dashboard /wp-admin2,209 ▲214.86 ▼0.02107.70 ▼0.6542.18 ▲2.98
Posts /wp-admin/edit.php2,092 ▲31.99 ▼0.0138.94 ▲4.4338.92 ▲0.31
Add New Post /wp-admin/post-new.php1,537 ▲1823.17 ▲0.02587.87 ▼8.4657.88 ▲5.11
Media Library /wp-admin/upload.php1,388 ▼04.25 ▼0.0194.87 ▲0.6941.46 ▲2.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'bpModLoader' not found in wp-content/plugins/bp-moderation/classes/bpModInstaller.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/bp-moderation/bpModLoader.php:44
    • > PHP Fatal error
      Uncaught Error: Class 'bpModeration' not found in wp-content/plugins/bp-moderation/classes/bpModBackend.php:8
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/bp-moderation/classes/bpModBackend.php on line 674
    • > PHP Fatal error
      Uncaught Error: Class 'bpModeration' not found in wp-content/plugins/bp-moderation/classes/bpModActions.php:6
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/bp-moderation/classes/bpModBackend.php on line 1130
    • > PHP Fatal error
      Uncaught Error: Class 'bpModeration' not found in wp-content/plugins/bp-moderation/classes/bpModBackendActions.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'bpModLoader' not found in wp-content/plugins/bp-moderation/classes/bpModObjContent.php:3
    • > PHP Parse error
      syntax error, unexpected 'new' (T_NEW) in wp-content/plugins/bp-moderation/classes/bpModeration.php on line 118
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/bp-moderation/classes/bpModBackend.php on line 697

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Tested up to: Version not formatted correctly
  • Requires at least: Version not formatted correctly
You can take inspiration from this readme.txt

bp-moderation/bpModLoader.php 85% from 13 tests

The main PHP file in "BuddyPress Moderation" ver. 0.1.7 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 151 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("bp-moderation.php" instead of "bpModLoader.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin3,272 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP136747672,954
JavaScript24711182
CSS2386136

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity30.77
▷ Minimum class complexity1.00
▷ Maximum class complexity168.00
Average method complexity3.73
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods142
▷ Static methods10.70%
▷ Public methods14199.30%
▷ Protected methods00.00%
▷ Private methods10.70%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/sprite.png1.07KB1.05KB▼ 1.56%