88% yourls-wordpress-to-twitter

Code Review | YOURLS: WordPress to Twitter

WordPress plugin YOURLS: WordPress to Twitter scored 88% from 54 tests.

About plugin

  • Plugin page: yourls-wordpress-...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-9.9
  • WordPress version: 5.8.1
  • First release: Jun 25, 2009
  • Latest release: Sep 13, 2014
  • Number of updates: 74
  • Update frequency: every 26.3 days
  • Top authors: ozh (63.51%)boonebgorges (37.84%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 89,468 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼133.32ms] Passed 4 tests

Server-side resources used by YOURLS: WordPress to Twitter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.0835.65 ▲5.74
Dashboard /wp-admin3.20 ▲0.1452.15 ▲6.58
Posts /wp-admin/edit.php3.31 ▲0.2047.38 ▲5.18
Add New Post /wp-admin/post-new.php5.56 ▲0.1395.87 ▼537.79
Media Library /wp-admin/upload.php3.14 ▲0.1332.38 ▼6.41
YOURLS /wp-admin/options-general.php?page=ozh_yourls3.0925.50

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for YOURLS: WordPress to Twitter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,724 ▲12815.92 ▲0.108.34 ▼0.8745.07 ▼5.92
Dashboard /wp-admin2,994 ▲605.89 ▼0.07133.62 ▼8.78114.16 ▼3.69
Posts /wp-admin/edit.php2,760 ▲212.70 ▲0.0165.50 ▲2.6592.87 ▲1.52
Add New Post /wp-admin/post-new.php1,628 ▼4421.67 ▲2.80265.01 ▼119.74102.41 ▼8.58
Media Library /wp-admin/upload.php1,831 ▲215.04 ▲0.03158.41 ▲10.29115.80 ▼10.49
YOURLS /wp-admin/options-general.php?page=ozh_yourls1,3902.4862.1587.92

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

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)
Smoke test failed, please fix the following
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ozh_yourls
    • > Notice in wp-content/plugins/yourls-wordpress-to-twitter/inc/options.php+190
    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
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-wordpress-to-twitter/inc/buddypress/bp-groups.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-wordpress-to-twitter/inc/buddypress/bp-members.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-wordpress-to-twitter/inc/buddypress/bp-members.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-wordpress-to-twitter/inc/buddypress/bp-admin.php:108
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yourls-wordpress-to-twitter/plugin.php:145

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% 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: Screenshot #1 (on the Write screen, you can (re)generate short URLs) image required
The official readme.txt might help

yourls-wordpress-to-twitter/plugin.php 92% from 13 tests

"YOURLS: WordPress to Twitter" version 1.6.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("yourls-wordpress-to-twitter.php" instead of "plugin.php")

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
Success! There were no dangerous files found in this plugin1,779 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP83845451,122
PO File2202237434
JavaScript23817181
CSS213042

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions67
▷ Named functions67100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
res/collapse.png0.33KB0.21KB▼ 35.61%
res/exclamation.png0.68KB0.72KB0.00%
res/accept.png0.76KB0.81KB0.00%
res/Sign-in-with-Twitter-lighter.png2.43KB1.77KB▼ 27.11%
res/expand.png0.35KB0.22KB▼ 38.33%