10% bits2bytes

Code Review | Bits2Bytes

WordPress plugin Bits2Bytes scored10%from 54 tests.

About plugin

  • Plugin page: bits2bytes
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0-4.5.3
  • WordPress version: 6.3.1
  • First release: Dec 25, 2015
  • Latest release: Aug 19, 2016
  • Number of updates: 11
  • Update frequency: every 21.7 days
  • Top authors: mostafas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /759 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/bits2bytes/bits2bytes.php+57
    Methods with the same name as their class will not be constructors in a future version of PHP; b2b_widget has a deprecated constructor

Server metrics [RAM: ▼1.88MB] [CPU: ▼56.60ms] Passed 4 tests

An overview of server-side resources used by Bits2Bytes
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.365.08 ▼42.16
Dashboard /wp-admin2.13 ▼1.185.98 ▼47.18
Posts /wp-admin/edit.php2.13 ▼1.237.65 ▼43.14
Add New Post /wp-admin/post-new.php2.13 ▼3.766.21 ▼93.92
Media Library /wp-admin/upload.php2.13 ▼1.105.19 ▼33.24

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/bits2bytes/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_b2b_bits2bytes_widget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Bits2Bytes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.25 ▼1.366.69 ▲4.8944.81 ▲1.14
Dashboard /wp-admin2,224 ▲214.87 ▼0.04100.57 ▼7.6741.97 ▼7.79
Posts /wp-admin/edit.php2,103 ▲32.05 ▲0.0135.21 ▼3.0832.97 ▼5.18
Add New Post /wp-admin/post-new.php1,550 ▲1923.42 ▲0.29616.61 ▼64.7473.63 ▲18.37
Media Library /wp-admin/upload.php1,400 ▼04.25 ▼0.0998.95 ▼17.9543.52 ▼4.06

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
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/bits2bytes/bits2bytes.php+57
    Methods with the same name as their class will not be constructors in a future version of PHP; b2b_widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_b2b_bits2bytes_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/bits2bytes/bits2bytes.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
The official readme.txt is a good inspiration

bits2bytes/bits2bytes.php 92% from 13 tests

The main PHP script in "Bits2Bytes" version 1.1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 194 characters long)

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
Everything looks great! No dangerous files found in this plugin296 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP13567188
CSS128108

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin