10% bing-website-translator

Code Review | Prisna BT - Bing Translator

WordPress plugin Prisna BT - Bing Translator scored10%from 54 tests.

About plugin

  • Plugin page: bing-website-tran...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-6.0
  • WordPress version: 6.3.1
  • First release: Oct 20, 2014
  • Latest release: Jun 19, 2023
  • Number of updates: 34
  • Update frequency: every 93.1 days
  • Top authors: Prisna (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /8,645 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/bing-website-translator/classes/common.class.php+972
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.67MB] [CPU: ▼51.39ms] Passed 4 tests

Analyzing server-side resources used by Prisna BT - Bing Translator
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.32 ▼1.145.18 ▼38.86
Dashboard /wp-admin2.34 ▼0.967.21 ▼43.32
Posts /wp-admin/edit.php2.35 ▼1.028.02 ▼40.31
Add New Post /wp-admin/post-new.php2.34 ▼3.556.43 ▼83.05
Media Library /wp-admin/upload.php2.34 ▼0.896.93 ▼31.77
Prisna BT - Bing Translator /wp-admin/plugins.php?page=prisna-bing-website-translator-settings2.456.32

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 147 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_prisna-bing-website-translator
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Prisna BT - Bing Translator: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.32 ▲0.111.70 ▲0.0139.59 ▼6.79
Dashboard /wp-admin2,198 ▲215.54 ▼0.1486.87 ▼5.1039.36 ▼2.55
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0333.75 ▼2.2635.16 ▼6.36
Add New Post /wp-admin/post-new.php1,529 ▲123.27 ▲0.15671.37 ▼18.0365.80 ▲9.71
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.02102.92 ▼14.7042.64 ▼7.25
Prisna BT - Bing Translator /wp-admin/plugins.php?page=prisna-bing-website-translator-settings4,1504.1288.44119.66

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/bing-website-translator/classes/common.class.php+972
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_prisna-bing-website-translator
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=prisna-bing-website-translator-settings
    • > Deprecated in wp-content/plugins/bing-website-translator/classes/common.class.php+1058
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/plugins.php?page=prisna-bing-website-translator-settings
    • > Warning in wp-content/plugins/bing-website-translator/classes/admin.class.php+345
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/bing-website-translator/bing-website-translator.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaBWTItem' not found in wp-content/plugins/bing-website-translator/classes/admin.class.php:149
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/bing-website-translator/classes/admin.class.php on line 345
    • > PHP Fatal error
      Uncaught Error: Class 'PrisnaBWTItem' not found in wp-content/plugins/bing-website-translator/classes/main.class.php:92
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/bing-website-translator/uninstall.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/bing-website-translator/classes/common.class.php:657

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)
Please fix the following browser errors
    • > GET request to /wp-admin/plugins.php?page=prisna-bing-website-translator-settings
    • > Javascript (severe) in unknown
    javascript 0:68401 Uncaught DOMException: Blocked a frame with origin "http://www.prisna.net" from accessing a cross-origin frame.

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #5 (Upgrade panel.) image not found
  • Screenshots: Please describe screenshot #2 in bing-website-translator/assets to your readme.txt
The official readme.txt is a good inspiration

bing-website-translator/bing-website-translator.php 85% from 13 tests

"Prisna BT - Bing Translator" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: The description should be shorter than 140 characters (currently 264 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin6,286 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP71,212722,541
SVG1001,990
CSS11961981
JavaScript226314600
PO File15960174

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.87
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods217
▷ Static methods10648.85%
▷ Public methods15571.43%
▷ Protected methods6228.57%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants16
▷ Global constants956.25%
▷ Class constants743.75%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
21 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/logo-promote.png9.48KB3.85KB▼ 59.39%
images/lower_right.png1.95KB1.53KB▼ 21.36%
images/header.png0.14KB0.13KB▼ 2.14%
images/tabbed_3.png0.21KB0.14KB▼ 31.13%
images/logo_white.png2.48KB2.10KB▼ 15.40%