84% ig-twitter-cards

Code Review | iG:Twitter Cards

WordPress plugin iG:Twitter Cards scored84%from 54 tests.

About plugin

  • Plugin page: ig-twitter-cards
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.8
  • WordPress version: 6.3.1
  • First release: Apr 8, 2013
  • Latest release: Nov 24, 2013
  • Number of updates: 10
  • Update frequency: every 23.0 days
  • Top authors: amit (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,988 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.57ms] Passed 4 tests

Server-side resources used by iG:Twitter Cards
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.99 ▼4.86
Dashboard /wp-admin3.32 ▲0.0245.64 ▼6.03
Posts /wp-admin/edit.php3.44 ▲0.0847.98 ▼4.26
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.02 ▼11.14
Media Library /wp-admin/upload.php3.24 ▲0.0234.23 ▲1.25
iG:Twitter Cards /wp-admin/options-general.php?page=ig-twitter-cards-page3.2231.08

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
ig-twitter-cards-options
widget_theysaidso_widget

Browser metrics Passed 4 tests

iG:Twitter Cards: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.23 ▼0.991.66 ▼0.0842.90 ▲0.41
Dashboard /wp-admin2,210 ▲224.79 ▼0.11108.89 ▼7.3339.32 ▼4.60
Posts /wp-admin/edit.php2,093 ▲42.05 ▲0.0240.58 ▲3.7136.17 ▲4.58
Add New Post /wp-admin/post-new.php1,530 ▲1123.22 ▲0.08675.59 ▲24.7256.52 ▼9.83
Media Library /wp-admin/upload.php1,392 ▲104.23 ▼0.0396.03 ▼4.3240.06 ▼5.59
iG:Twitter Cards /wp-admin/options-general.php?page=ig-twitter-cards-page9461.6824.2429.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • ig-twitter-cards-options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'iG_Twitter_Cards' not found in wp-content/plugins/ig-twitter-cards/class-ig-twitter-cards-frontend.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'iG_Twitter_Cards' not found in wp-content/plugins/ig-twitter-cards/class-ig-twitter-cards-admin.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ig-twitter-cards/ig-twitter-cards.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: player card, cards, twitter, share, twitter cards...

ig-twitter-cards/ig-twitter-cards.php Passed 13 tests

"iG:Twitter Cards" version 1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
This plugin enables Twitter Cards on a site. Check Twitter Cards documentation for details - https://dev.twitter.com/docs/cards

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin764 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4156222612
JavaScript3203979
CSS212973

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity41.00
▷ Minimum class complexity18.00
▷ Maximum class complexity63.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods34
▷ Static methods12.94%
▷ Public methods1544.12%
▷ Protected methods720.59%
▷ Private methods1235.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin