72% semalt

Code Review | Semalt Blocker

WordPress plugin Semalt Blocker scored 72% from 54 tests.

About plugin

  • Plugin page: semalt
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0
  • WordPress version: 5.8.1
  • First release: Nov 20, 2014
  • Latest release: Feb 24, 2015
  • Number of updates: 10
  • Update frequency: every 9.8 days
  • Top authors: alexmoss (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active / 8,929 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼142.72ms] 75% from 4 tests

This is a short check of server-side resources used by Semalt Blocker
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 11,609.02ms on /wp-admin/options-general.php?page=semalt)
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1243.49 ▲18.68
Dashboard /wp-admin3.09 ▲0.0443.69 ▼2.16
Posts /wp-admin/edit.php3.14 ▲0.0445.56 ▲3.83
Add New Post /wp-admin/post-new.php5.45 ▲0.0288.34 ▼572.74
Media Library /wp-admin/upload.php3.04 ▲0.0332.36 ▲0.21
Semalt Redirect Manager /wp-admin/options-general.php?page=semalt3.4511,609.02

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
semalt

Browser metrics Passed 4 tests

Checking browser requirements for Semalt Blocker
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.90 ▲0.239.38 ▲0.6345.03 ▼8.08
Dashboard /wp-admin2,975 ▲416.11 ▼0.01143.53 ▼6.46105.72 ▼6.21
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0069.62 ▲0.9293.37 ▲5.96
Add New Post /wp-admin/post-new.php1,618 ▲12021.34 ▲2.48337.32 ▼43.63106.20 ▲2.97
Media Library /wp-admin/upload.php1,812 ▲55.06 ▲0.04147.12 ▼6.08118.17 ▼5.20
Semalt Redirect Manager /wp-admin/options-general.php?page=semalt1,2686.70245.27132.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • semalt

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Warning in wp-content/plugins/semalt/class-admin.php+163
    Invalid argument supplied for foreach()

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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/semalt/semalt.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/semalt/class-admin.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Network (severe)
    https://apis.google.com/u/0/se/0/_/+1/fastbutton?usegapi=1&size=medium&hl=en-GB&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Fpeadig.com%2Fwordpress-plugins%2Fsemalt%2F&gsrc=3p&ic=1&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I2_1637325103628&_gfid=I2_1637325103628&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=36896721 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Network (severe)
    https://apis.google.com/u/0/_/widget/render/follow?usegapi=1&annotation=bubble&height=20&rel=publisher&hl=en-GB&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Fplus.google.com%2F116387945649998056474&gsrc=3p&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I0_1637325103611&_gfid=I0_1637325103611&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=42496112 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Network (severe)
    https://apis.google.com/u/0/_/widget/render/follow?usegapi=1&annotation=bubble&height=20&rel=author&hl=en-GB&origin=http%3A%2F%2Fwp.com&url=http%3A%2F%2Fplus.google.com%2F%2BAlexMoss&gsrc=3p&jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en_US.7Qaqnm_1sO0.O%2Fam%3DAQ%2Fd%3D1%2Frs%3DAGLTcCMlhJgy_5nQ_Wt0jHMAZa6UDzBuWQ%2Fm%3D__features__#_methods=onPlusOne%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart%2Concircled%2Cdrefresh%2Cerefresh%2Conload&id=I1_1637325103621&_gfid=I1_1637325103621&parent=http%3A%2F%2Fwp.com&pfname=&rpctoken=39021943 - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'http://badge.stumbleupon.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
    • > GET request to /wp-admin/options-general.php?page=semalt
    • > Javascript (severe) in unknown
    https://button.buffer.com/button/?id=fa987594f6697e91&url=http%3A%2F%2Fpeadig.com%2Fwordpress-plugins%2Fsemalt%2F&text=Just%20been%20using%20Semalt%20Redirect%20Manager%20%23WordPress%20plugin&via=alexmoss&count=horizontal&placement=button&utm_source=http%3A%2F%2Fwp.com%2Fwp-admin%2Foptions-general.php%3Fpage%3Dsemalt&utm_medium=buffer_button&utm_campaign=buffer 15:647 Uncaught TypeError: Cannot set properties of null (setting 'onclick')

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
3 plugin tags: seo, redirect, semalt

semalt/semalt.php 92% from 13 tests

"Semalt Blocker" version 1.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 200 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin286 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24334185
CSS1120101

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/peadig-landscape-300.png4.33KB2.49KB▼ 42.63%