68% image-nsfw

Code Review | Image (NSFW)

WordPress plugin Image (NSFW) scored68%from 54 tests.

About plugin

  • Plugin page: image-nsfw
  • Plugin version: 1.0.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Oct 25, 2021
  • Number of updates: 80
  • Update frequency: every 22.7 days
  • Top authors: mdr8 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /2,345 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.80MB] [CPU: ▼53.95ms] Passed 4 tests

Analyzing server-side resources used by Image (NSFW)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.276.77 ▼37.87
Dashboard /wp-admin2.21 ▼1.097.21 ▼49.33
Posts /wp-admin/edit.php2.21 ▼1.158.51 ▼41.74
Add New Post /wp-admin/post-new.php2.21 ▼3.689.24 ▼86.86
Media Library /wp-admin/upload.php2.21 ▼1.026.39 ▼32.79

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: 1 new table, 7 new options
New tables
wp_moderate_content_requests
New WordPress options
db_upgraded
widget_recent-posts
MODERATECONTENT__PLUGIN_debug
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Image (NSFW): an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲12913.48 ▼0.878.73 ▲6.3843.85 ▼1.51
Dashboard /wp-admin2,213 ▲365.65 ▲0.0488.57 ▼12.1439.38 ▼6.11
Posts /wp-admin/edit.php2,118 ▲182.01 ▲0.0143.68 ▲6.0935.75 ▼1.14
Add New Post /wp-admin/post-new.php1,555 ▲2923.32 ▲5.56676.31 ▲14.9551.41 ▲1.20
Media Library /wp-admin/upload.php1,415 ▲154.23 ▲0.02103.23 ▼3.3342.49 ▼7.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the admin_3 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/image-nsfw/image-nsfw.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-nsfw/admin.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% 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:
  • Screenshots: These screenshots need descriptions #2, #3, #4, #5 in image-nsfw/assets to your readme.txt
You can take inspiration from this readme.txt

image-nsfw/image-nsfw.php 92% from 13 tests

The main file in "Image (NSFW)" v. 1.0.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin938 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP484134766
JavaScript2166172

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/rating_adult-150x150.png7.67KB3.97KB▼ 48.31%
img/rating_everyone.png11.92KB4.44KB▼ 62.71%
img/rating_adult.png10.84KB3.86KB▼ 64.41%
img/rating_adult-187x300.png18.93KB7.66KB▼ 59.51%
img/rating_adult_box.png11.89KB4.22KB▼ 64.52%