10% my-two-cents

Code Review | My Two Cents

WordPress plugin My Two Cents scored10%from 54 tests.

About plugin

  • Plugin page: my-two-cents
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Sep 18, 2014
  • Latest release: Sep 25, 2014
  • Number of updates: 8
  • Update frequency: every 0.9 days
  • Top authors: meitar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,197 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+804
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpc_client has a deprecated constructor

Server metrics [RAM: ▼1.02MB] [CPU: ▼52.97ms] Passed 4 tests

An overview of server-side resources used by My Two Cents
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▼0.508.25 ▼45.20
Dashboard /wp-admin2.98 ▼0.328.81 ▼37.71
Posts /wp-admin/edit.php2.98 ▼0.3710.08 ▼39.91
Add New Post /wp-admin/post-new.php2.98 ▼2.907.77 ▼89.05
Media Library /wp-admin/upload.php2.98 ▼0.249.24 ▼25.08
My Two Cents /wp-admin/options-general.php?page=my_two_cents_settings2.988.74

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by My Two Cents
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.48 ▼0.042.04 ▲0.0740.15 ▼3.38
Dashboard /wp-admin2,207 ▲165.83 ▲0.9294.89 ▼9.7838.91 ▼5.26
Posts /wp-admin/edit.php2,093 ▲42.04 ▼0.0139.44 ▼0.6835.94 ▲0.58
Add New Post /wp-admin/post-new.php1,536 ▼723.54 ▲5.21671.47 ▲5.2158.10 ▼2.19
Media Library /wp-admin/upload.php1,386 ▲14.36 ▲0.1395.10 ▼8.6139.96 ▼4.33
My Two Cents /wp-admin/options-general.php?page=my_two_cents_settings9272.1833.3545.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+804
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpc_client has a deprecated constructor
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+804
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpc_client has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+1929
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpcresp has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+2087
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpcmsg has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/xmlrpc.inc+2712
    Methods with the same name as their class will not be constructors in a future version of PHP; xmlrpcval has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Deprecated in wp-content/plugins/my-two-cents/lib/bitcoin-php/src/includes/jsonrpc.inc+918
    Methods with the same name as their class will not be constructors in a future version of PHP; jsonrpcmsg has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=my_two_cents_settings
    • > Notice in wp-content/plugins/my-two-cents/my-two-cents.php+48
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/my-two-cents/my-two-cents.php:21

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 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (When you first install My Two Cents, you'll need to enter one or more of your receiving addresses. Other options allow you to tweak display and security options such as the size of the generated QR code image and the number of network confirmations required before a transaction is considered valid.), #2 (When a comment is submitted, My Two Cents offers a direct clickable link and a QR code with which the commenter can send you BitCoin. Within the hour of their BitCoin transaction being confirmed on the blockchain, My Two Cents will approve their comment automatically.), #3 (Optionally, My Two Cents can also use "transaction polling," a method for detecting transactions without the use of automatically-generated forarding addresses. If you choose to enable this feature, My Two Cents adds a "BitCoin address" field to your comment forms. Commenters provide their BitCoin address here to register their "My Two Cents.")
The official readme.txt is a good inspiration

my-two-cents/my-two-cents.php Passed 13 tests

The principal PHP file in "My Two Cents" v. 0.2 is loaded by WordPress automatically on each request
92 characters long description:
Receive BitCoin from your commenters. Auto-approve comments that include a BitCoin donation.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin5,091 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP63651,5454,473
Pascal168305588
Markdown116030

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity77.00
▷ Minimum class complexity77.00
▷ Maximum class complexity77.00
Average method complexity4.04
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods1456.00%
▷ Protected methods00.00%
▷ Private methods1144.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.34MB with 0.23MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png251.51KB77.61KB▼ 69.14%
screenshot-3.png50.55KB14.96KB▼ 70.40%
screenshot-2.png42.18KB12.65KB▼ 70.01%