84% jm-twitter-cards

Code Review | JM Twitter Cards

WordPress plugin JM Twitter Cards scored84%from 54 tests.

About plugin

  • Plugin page: jm-twitter-cards
  • Plugin version: 12...
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Dec 5, 2012
  • Latest release: May 12, 2023
  • Number of updates: 246
  • Update frequency: every 15.5 days
  • Top authors: jmlapam (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

8,000+ active /339,097 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.48MB] [CPU: ▼4.00ms] 75% from 4 tests

An overview of server-side resources used by JM Twitter Cards
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 2,199.18ms on /wp-admin/admin.php?page=jm_tc_tutorials)
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4738.82 ▼3.58
Dashboard /wp-admin3.84 ▲0.4963.98 ▼7.62
Posts /wp-admin/edit.php3.89 ▲0.5356.80 ▲4.12
Add New Post /wp-admin/post-new.php6.39 ▲0.5094.91 ▼8.92
Media Library /wp-admin/upload.php3.70 ▲0.4745.43 ▲7.16
Tutorials /wp-admin/admin.php?page=jm_tc_tutorials3.712,199.18
JM Twitter Cards /wp-admin/admin.php?page=jm_tc3.7042.40
About /wp-admin/admin.php?page=jm_tc_about3.6736.52
Import / Export /wp-admin/admin.php?page=jm_tc_import_export3.6841.67

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 57 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
jm_tc
jm_tc_cpt
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for JM Twitter Cards
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲10513.21 ▼1.541.77 ▼0.0048.44 ▲4.31
Dashboard /wp-admin2,253 ▲505.79 ▲0.90104.17 ▼4.4939.29 ▼6.55
Posts /wp-admin/edit.php2,135 ▲322.00 ▼0.0336.20 ▼4.4331.33 ▼9.58
Add New Post /wp-admin/post-new.php1,564 ▲1823.76 ▲0.63614.93 ▼47.1955.15 ▲0.28
Media Library /wp-admin/upload.php1,435 ▲384.09 ▼0.15119.65 ▼0.0147.12 ▼5.06
Tutorials /wp-admin/admin.php?page=jm_tc_tutorials3,13615.80131.6866.14
JM Twitter Cards /wp-admin/admin.php?page=jm_tc1,3203.2653.8032.78
About /wp-admin/admin.php?page=jm_tc_about7872.0328.4532.34
Import / Export /wp-admin/admin.php?page=jm_tc_import_export8702.0628.6333.11

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/jm-twitter-cards/jm-twitter-cards.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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: cards, twitter, product, photo, gallery...

jm-twitter-cards/jm-twitter-cards.php 92% from 13 tests

The main file in "JM Twitter Cards" v. 12... serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "12...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin3,100 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP234746471,944
PO File3396489876
JavaScript91220223
CSS72043
SVG1008
JSON6006

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.38
Average class complexity18.23
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity2.98
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods103
▷ Static methods1615.53%
▷ Public methods9693.20%
▷ Protected methods76.80%
▷ Private methods00.00%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/Twitter_logo_blue.png22.16KB9.21KB▼ 58.46%