10% u-tweets

Code Review | U-Tweets

WordPress plugin U-Tweets scored 10% from 54 tests.

About plugin

  • Plugin page: u-tweets
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.5.2
  • WordPress version: 5.8.1
  • First release: Jun 23, 2013
  • Latest release: Jun 23, 2013
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: ultimatumtheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,466 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/u-tweets/utweets.php+34
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.86MB] [CPU: ▼190.74ms] Passed 4 tests

Analyzing server-side resources used by U-Tweets
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼1.066.45 ▼29.51
Dashboard /wp-admin1.79 ▼1.266.07 ▼37.45
Posts /wp-admin/edit.php1.79 ▼1.316.28 ▼38.37
Add New Post /wp-admin/post-new.php1.79 ▼3.646.64 ▼655.88
Media Library /wp-admin/upload.php1.79 ▼1.216.18 ▼31.25
U-Tweets /wp-admin/options-general.php?page=U-Tweets1.796.65

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

U-Tweets: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,834 ▲23816.56 ▲0.9811.31 ▲3.5848.76 ▼4.18
Dashboard /wp-admin2,992 ▲615.92 ▼0.00131.77 ▼15.29119.99 ▲4.14
Posts /wp-admin/edit.php2,761 ▲222.69 ▼0.0066.58 ▲4.4698.92 ▲2.20
Add New Post /wp-admin/post-new.php1,686 ▼18618.89 ▼0.20357.03 ▲7.34104.01 ▼6.99
Media Library /wp-admin/upload.php1,829 ▲165.01 ▲0.01150.81 ▲11.31118.97 ▼6.30
U-Tweets /wp-admin/options-general.php?page=U-Tweets1,1852.2157.9278.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/u-tweets/utweets.php+34
    Trying to access array offset on value of type bool

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=U-Tweets
    • > Notice in wp-content/plugins/u-tweets/lib/admin.php+28
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=U-Tweets
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/u-tweets/utweets.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/u-tweets/lib/admin.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/u-tweets/lib/widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Twitter OAuth Settings), #2 (Widget options), #3 (Sample Tweets Display)
The official readme.txt might help

u-tweets/utweets.php 92% from 13 tests

"U-Tweets" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("u-tweets.php" instead of "utweets.php")

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
Everything looks great! No dangerous files found in this plugin1,234 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6186384887
JavaScript12725270
PO File127364
Markdown15011
CSS1002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity35.25
▷ Minimum class complexity18.00
▷ Maximum class complexity66.00
Average method complexity4.19
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods920.93%
▷ Public methods2148.84%
▷ Protected methods00.00%
▷ Private methods2251.16%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.14MB with 0.11MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png71.39KB15.08KB▼ 78.88%
screenshot-3.png45.71KB10.97KB▼ 75.99%
screenshot-1.png24.58KB5.82KB▼ 76.33%