84% mdc-target-blank

Code Review | Target _blank - Force links to open in a new tab

WordPress plugin Target _blank - Force links to open in a new tab scored84%from 54 tests.

About plugin

  • Plugin page: mdc-target-blank
  • Plugin version: 3.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 24, 2014
  • Latest release: Jul 1, 2023
  • Number of updates: 23
  • Update frequency: every 142.0 days
  • Top authors: mukto90 (91.3%)codexpert (13.04%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /5,514 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.20MB] [CPU: ▼1.16ms] Passed 4 tests

Analyzing server-side resources used by Target _blank - Force links to open in a new tab
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.99 ▲4.99
Dashboard /wp-admin3.57 ▲0.2749.07 ▼3.22
Posts /wp-admin/edit.php3.62 ▲0.2649.12 ▼0.12
Add New Post /wp-admin/post-new.php6.11 ▲0.2295.36 ▼5.62
Media Library /wp-admin/upload.php3.43 ▲0.2036.84 ▲4.34

Server storage [IO: ▲0.31MB] [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: 64 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
mdc-target-blank_install_time
can_compress_scripts
mdc-target-blank_version

Browser metrics Passed 4 tests

An overview of browser requirements for Target _blank - Force links to open in a new tab
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,903 ▲15714.04 ▼0.258.46 ▲6.6042.43 ▲1.27
Dashboard /wp-admin2,207 ▲335.90 ▲0.9896.65 ▼8.5876.51 ▲35.67
Posts /wp-admin/edit.php2,109 ▲172.01 ▲0.0239.29 ▼0.4534.92 ▲0.53
Add New Post /wp-admin/post-new.php1,552 ▲3318.50 ▼4.51659.60 ▲9.0864.15 ▲12.08
Media Library /wp-admin/upload.php1,396 ▲54.14 ▼0.02108.74 ▲12.8146.18 ▲6.33

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • 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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/plugin.php' (include_path='.:/usr/share/php') in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mdc-target-blank/views/settings/table.php:7
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/mdc-target-blank/inc/functions.php on line 3

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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: new tab, target blank, target _blank, link new tab, external link...

mdc-target-blank/mdc-target-blank.php 92% from 13 tests

The main file in "Target _blank - Force links to open in a new tab" v. 3.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin4,813 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP391,0161,2113,562
CSS715848
JavaScript6140232
JSON500169
Markdown2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity27.75
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes24
▷ Abstract classes28.33%
▷ Concrete classes2291.67%
▷ Final classes14.55%
Methods246
▷ Static methods249.76%
▷ Public methods23294.31%
▷ Protected methods20.81%
▷ Private methods124.88%
Functions9
▷ Named functions111.11%
▷ Anonymous functions888.89%
Constants6
▷ Global constants6100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/codexpert/plugin/src/assets/img/checked.png18.81KB9.90KB▼ 47.36%
vendor/codexpert/plugin/src/assets/img/survey.png7.31KB3.08KB▼ 57.88%
assets/img/icon.png1.54KB1.04KB▼ 32.13%