10% eewee-twitter-card

Code Review | eewee twitter card

WordPress plugin eewee twitter card scored 10% from 54 tests.

About plugin

  • Plugin page: eewee-twitter-card
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Dec 2, 2012
  • Latest release: Sep 5, 2014
  • Number of updates: 25
  • Update frequency: every 25.7 days
  • Top authors: eewee (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,563 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+2
    Use of undefined constant EeweeTwitterCard - assumed 'EeweeTwitterCard' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.90MB] [CPU: ▼54.06ms] Passed 4 tests

Analyzing server-side resources used by eewee twitter card
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.35 ▼45.44
Dashboard /wp-admin2.11 ▼1.207.25 ▼40.02
Posts /wp-admin/edit.php2.11 ▼1.256.44 ▼44.28
Add New Post /wp-admin/post-new.php2.11 ▼3.786.11 ▼86.49
Media Library /wp-admin/upload.php2.11 ▼1.126.24 ▼29.32
Setting /wp-admin/admin.php?page=idSousMenuTC12.117.17
Manual /wp-admin/admin.php?page=idSousMenuTC22.116.40
Eewee Twitter Card /wp-admin/admin.php?page=idEeweeTwitterCard2.116.41

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for eewee twitter card
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.27 ▼1.154.02 ▲2.1539.52 ▼0.27
Dashboard /wp-admin2,246 ▲585.94 ▲0.03106.77 ▲3.2786.42 ▲40.12
Posts /wp-admin/edit.php2,129 ▲402.02 ▲0.0237.47 ▼3.5636.94 ▼5.76
Add New Post /wp-admin/post-new.php1,554 ▲1723.13 ▼0.09731.00 ▲69.4967.85 ▲6.63
Media Library /wp-admin/upload.php1,427 ▲424.18 ▼0.0895.10 ▼6.7375.51 ▲34.20
Setting /wp-admin/admin.php?page=idSousMenuTC19352.0725.0523.84
Manual /wp-admin/admin.php?page=idSousMenuTC29422.0223.3635.51
Eewee Twitter Card /wp-admin/admin.php?page=idEeweeTwitterCard7982.0123.8924.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+2
    Use of undefined constant EeweeTwitterCard - assumed 'EeweeTwitterCard' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+2
    Use of undefined constant EeweeTwitterCard - assumed 'EeweeTwitterCard' (this will throw an Error in a future version of PHP)
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Notice in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+161
    Undefined property: EeweeTwitterCard::$adminOptionsName
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+30
    Use of undefined constant menu - assumed 'menu' (this will throw an Error in a future version of PHP)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+32
    Use of undefined constant sousMenu1 - assumed 'sousMenu1' (this will throw an Error in a future version of PHP)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Warning in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php+33
    Use of undefined constant sousMenu2 - assumed 'sousMenu2' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/eewee-twitter-card/view/manual.php
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/eewee-twitter-card/index.php on line 18
    • > PHP Warning
      Use of undefined constant EeweeTwitterCard - assumed 'EeweeTwitterCard' (this will throw an Error in a future version of PHP) in wp-content/plugins/eewee-twitter-card/controllers/EeweeTwitterCard.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'form_add_twitterCard' not found in wp-content/plugins/eewee-twitter-card/view/twittercard.php:14
    • > PHP Notice
      Undefined index: type in wp-content/plugins/eewee-twitter-card/view/root.php on line 3
    • > PHP Warning
      include(EEWEE_TWITTERCARD_PLUGIN_DIR/view/twittercard.php): failed to open stream: No such file or directory in wp-content/plugins/eewee-twitter-card/view/root.php on line 8
    • > PHP Warning
      include(): Failed opening 'EEWEE_TWITTERCARD_PLUGIN_DIR/view/twittercard.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/eewee-twitter-card/view/root.php on line 8
    • > PHP Warning
      Use of undefined constant EEWEE_TWITTERCARD_PLUGIN_DIR - assumed 'EEWEE_TWITTERCARD_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/eewee-twitter-card/view/root.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/eewee-twitter-card/index.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Network (severe)
    wp-content/plugins/eewee_twitter_card/css/themes/base/jquery.ui.all.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Network (severe)
    wp-content/plugins/eewee_twitter_card/css/style.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=idEeweeTwitterCard
    • > Network (severe)
    wp-content/plugins/eewee_twitter_card/img/icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

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: Add an image for screenshot #1 (Player Card.)
The official readme.txt might help

eewee-twitter-card/index.php 92% from 13 tests

"eewee twitter card" version 1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("eewee-twitter-card.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin285 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP673114252
PO File1285133
CSS1010

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.00
▷ Minimum class complexity3.00
▷ Maximum class complexity7.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon.png0.59KB0.47KB▼ 20.56%