10% gg-twitter

Code Review | GG Twitter

WordPress plugin GG Twitter scored 10% from 54 tests.

About plugin

  • Plugin page: gg-twitter
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 5.8.1
  • First release: Nov 13, 2012
  • Latest release: Jul 13, 2013
  • Number of updates: 13
  • Update frequency: every 18.9 days
  • Top authors: ggutenberg (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 6,256 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/gg-twitter/gg-twitter.php+93
    Declaration of GgTwitterWidget::save_settings() should be compatible with WP_Widget::save_settings($settings)

Server metrics [RAM: ▼1.74MB] [CPU: ▼190.71ms] Passed 4 tests

This is a short check of server-side resources used by GG Twitter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.89 ▼0.955.18 ▼28.22
Dashboard /wp-admin1.90 ▼1.155.88 ▼42.46
Posts /wp-admin/edit.php1.91 ▼1.205.27 ▼41.06
Add New Post /wp-admin/post-new.php1.91 ▼3.535.97 ▼640.42
Media Library /wp-admin/upload.php1.91 ▼1.105.50 ▼38.91
GG Twitter /wp-admin/options-general.php?page=ggtwitter1.915.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 1 new option
New WordPress options
ggtwitter_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for GG Twitter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.87 ▲0.4513.92 ▲2.6548.83 ▲3.46
Dashboard /wp-admin2,972 ▲385.92 ▼0.08146.39 ▼20.93108.88 ▼2.63
Posts /wp-admin/edit.php2,744 ▲52.73 ▲0.0164.85 ▼6.3587.35 ▲1.67
Add New Post /wp-admin/post-new.php1,679 ▼1,95518.85 ▲3.85406.35 ▼112.65108.35 ▼6.76
Media Library /wp-admin/upload.php1,815 ▲85.03 ▲0.00154.36 ▼15.13111.00 ▼30.86
GG Twitter /wp-admin/options-general.php?page=ggtwitter1,1652.0957.7472.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/gg-twitter/gg-twitter.php+93
    Declaration of GgTwitterWidget::save_settings() should be compatible with WP_Widget::save_settings($settings)
  • Zombie WordPress options were found after uninstall: 1 option
    • ggtwitter_settings

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > Warning in wp-content/plugins/gg-twitter/gg-twitter.php+93
    Declaration of GgTwitterWidget::save_settings() should be compatible with WP_Widget::save_settings($settings)
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in GgTwitterWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method GgTwitterWidget::add_settings_page() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method GgTwitterWidget::save_settings() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > Deprecated in wp-includes/class-wp-hook.php+303
    Non-static method GgTwitterWidget::settings_view() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=ggtwitter
    • > Deprecated in wp-content/plugins/gg-twitter/gg-twitter.php+120
    Non-static method GgTwitterWidget::validate_settings() should not be called statically

SRP 0% 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
  • 6× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/gg-twitter/includes/Twitter/connect.php
    • > /wp-content/plugins/gg-twitter/includes/Twitter/clearsessions.php
    • > /wp-content/plugins/gg-twitter/includes/Twitter/index.php
    • > /wp-content/plugins/gg-twitter/includes/Twitter/test.php
    • > /wp-content/plugins/gg-twitter/includes/Twitter/redirect.php
    • > /wp-content/plugins/gg-twitter/includes/Twitter/callback.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/gg-twitter/includes/Twitter/twitteroauth/twitteroauth.php on line 118
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/gg-twitter/includes/Twitter/twitteroauth/twitteroauth.php on line 82
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gg-twitter/includes/Twitter/test.php on line 20
    • > PHP Notice
      Undefined property: stdClass::$remaining_hits in wp-content/plugins/gg-twitter/includes/Twitter/test.php on line 24
    • > PHP Notice
      Undefined index: oauth_token in wp-content/plugins/gg-twitter/includes/Twitter/redirect.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gg-twitter/gg-twitter.php:10
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/gg-twitter/includes/Twitter/index.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/gg-twitter/includes/Twitter/test.php on line 20
    • > PHP Notice
      Undefined index: oauth_verifier in wp-content/plugins/gg-twitter/includes/Twitter/callback.php on line 23
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/gg-twitter/includes/Twitter/test.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (Widget configuration screen) image missing
You can take inspiration from this readme.txt

gg-twitter/gg-twitter.php Passed 13 tests

This is the main PHP file of "GG Twitter" version 1.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
29 characters long description:
Grinning Gecko Twitter Widget

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,335 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP113455151,335

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity10.15
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods88
▷ Static methods1011.36%
▷ Public methods7787.50%
▷ Protected methods22.27%
▷ Private methods910.23%
Functions3
▷ Named functions3100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/Twitter/images/lighter.png2.43KB1.77KB▼ 27.11%
screenshot-1.png34.83KB10.20KB▼ 70.73%
includes/Twitter/images/darker.png2.31KB1.70KB▼ 26.41%