62% postcard-social

Code Review | Postcard Social Networking Plugin for WordPress

WordPress plugin Postcard Social Networking Plugin for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: postcard-social
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2013
  • Latest release: Apr 4, 2014
  • Number of updates: 31
  • Update frequency: every 3.1 days
  • Top authors: bitwit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,966 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.00MB] [CPU: ▼11.46ms] Passed 4 tests

An overview of server-side resources used by Postcard Social Networking Plugin for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.32 ▼11.26
Dashboard /wp-admin3.31 ▼0.0349.42 ▼17.43
Posts /wp-admin/edit.php3.36 ▲0.0153.04 ▼1.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.17 ▼15.87
Media Library /wp-admin/upload.php3.24 ▲0.0137.66 ▲3.66
My postcards /wp-admin/admin.php?page=postcard_listing3.2634.74
Postcard /wp-admin/admin.php?page=postcard3.2727.57

Server storage [IO: ▲0.45MB] [DB: ▲0.08MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 39 new files
Database: 5 new tables, 7 new options
New tables
wp_pc_tags_posts
wp_pc_network_posts
wp_pc_postcards
wp_pc_tags
wp_pc_auth_tokens
New WordPress options
can_compress_scripts
db_upgraded
ca.bitwit.postcard/social-archive-install
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Postcard Social Networking Plugin for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,933 ▲18713.96 ▼0.427.60 ▲5.6040.11 ▼2.66
Dashboard /wp-admin2,241 ▲565.87 ▼0.03108.46 ▼7.6081.05 ▲37.92
Posts /wp-admin/edit.php2,124 ▲351.98 ▼0.0539.95 ▲4.6934.47 ▼0.32
Add New Post /wp-admin/post-new.php1,546 ▲2422.97 ▼0.30753.47 ▲99.5563.10 ▲12.15
Media Library /wp-admin/upload.php1,416 ▲284.18 ▼0.05101.96 ▲1.0686.25 ▲40.99
My postcards /wp-admin/admin.php?page=postcard_listing8772.0225.7325.66
Postcard /wp-admin/admin.php?page=postcard1,0151.7530.8835.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_pc_auth_tokens
    • wp_pc_tags
    • wp_pc_tags_posts
    • wp_pc_network_posts
    • wp_pc_postcards
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • ca.bitwit.postcard/social-archive-install
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 output text when accessed directly:
    • > /wp-content/plugins/postcard-social/postcard-core/templates/post-template-custom-default.php
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function postcard_style_post_message() in wp-content/plugins/postcard-social/postcard-core/templates/post-template-default.php:1
    • > PHP Notice
      Trying to get property 'message' of non-object in wp-content/plugins/postcard-social/postcard-core/templates/postcard-meta.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/postcard-social/postcard-core/admin-pages/settings.php:201
    • > PHP Fatal error
      Uncaught Error: Call to undefined function postcard_get_permalink() in wp-content/plugins/postcard-social/postcard-core/meta-templates/postcard-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function postcard_get_permalink() in wp-content/plugins/postcard-social/postcard-core/templates/postcard-meta.php:3
    • > PHP Notice
      Undefined variable: postcard in wp-content/plugins/postcard-social/postcard-core/templates/postcard-meta.php on line 1
    • > PHP Notice
      Undefined variable: postcard in wp-content/plugins/postcard-social/postcard-core/meta-templates/postcard-meta.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/postcard-social/postcard.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/postcard-social/postcard-core/startup.php:86
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/postcard-social/postcard-core/meta-templates/postcard-meta-page.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=postcard
    • > Network (severe)
    wp-content/plugins/postcard-social/postcard-core/img/admin-icon.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: feed, networking, postcard, social

postcard-social/postcard.php 92% from 13 tests

The principal PHP file in "Postcard Social Networking Plugin for WordPress" v. 1.4.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("postcard-social.php" instead of "postcard.php")

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 plugin6,797 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript31,0842,7973,851
PHP14210641,623
CSS323180792
Sass1316217
CoffeeScript23319204
SVG10065
HTML16322
JSON10013
Ruby15510

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods17.69%
▷ Protected methods00.00%
▷ Private methods1292.31%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
postcard-core/img/gallery-next.png1.18KB0.24KB▼ 79.95%
postcard-core/img/gallery-prev.png1.20KB0.25KB▼ 78.98%
postcard-core/img/user-blank.png3.10KB1.60KB▼ 48.39%
postcard-core/img/video-play-button.png1.96KB1.38KB▼ 29.70%