56% who-owns-your-country

Code Review | Who owns Your Country?

WordPress plugin Who owns Your Country? scored 56% from 54 tests.

About plugin

  • Plugin page: who-owns-your-cou...
  • Plugin version: 0.94
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.1
  • WordPress version: 6.3.1
  • First release: Jan 19, 2014
  • Latest release: Jan 23, 2015
  • Number of updates: 60
  • Update frequency: every 6.2 days
  • Top authors: dtygel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,327 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.15MB] [CPU: ▼6.66ms] Passed 4 tests

Server-side resources used by Who owns Your Country?
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.5422.63 ▼27.30
Dashboard /wp-admin3.42 ▲0.1255.53 ▲2.35
Posts /wp-admin/edit.php3.48 ▲0.1255.61 ▲1.61
Add New Post /wp-admin/post-new.php5.57 ▼0.3298.68 ▼3.27
Media Library /wp-admin/upload.php3.34 ▲0.1243.66 ▲2.32
Owner Types /wp-admin/edit-tags.php?taxonomy=whoowns_owner_types&post_type=whoowns_owner3.4346.59
Source Types /wp-admin/edit-tags.php?taxonomy=whoowns_source_types&post_type=whoowns_owner3.3442.61
All Owners /wp-admin/edit.php?post_type=whoowns_owner3.3942.63
New Owner /wp-admin/post-new.php?post_type=whoowns_owner3.4162.65
States /wp-admin/edit-tags.php?taxonomy=whoowns_geo&post_type=whoowns_owner3.3956.79

Server storage [IO: ▲2.02MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 194 new files
Database: 2 new tables, 29 new options
New tables
wp_whoowns_networks_cache
wp_whoowns_shares
New WordPress options
widget_theysaidso_widget
db_upgraded
whoowns_legends_format
whoowns_geo_children
can_compress_scripts
whoowns_owner_image_size
whoowns_supported_file_types
whoowns_threshold_show_arrows_in_network_when_move
widget_recent-posts
whoowns_capabilities
...

Browser metrics Passed 4 tests

A check of browser resources used by Who owns Your Country?
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲18714.15 ▲0.948.84 ▲7.1646.74 ▲2.52
Dashboard /wp-admin2,259 ▲504.98 ▼0.87113.52 ▲12.7677.41 ▲40.58
Posts /wp-admin/edit.php2,153 ▲612.05 ▲0.0139.99 ▲2.8338.86 ▲6.35
Add New Post /wp-admin/post-new.php6,662 ▲5,12923.73 ▲0.431,039.18 ▲245.3242.26 ▼11.44
Media Library /wp-admin/upload.php1,464 ▲764.35 ▲0.1395.97 ▼21.5572.33 ▲29.19
Owner Types /wp-admin/edit-tags.php?taxonomy=whoowns_owner_types&post_type=whoowns_owner1,5131.9433.2136.16
Source Types /wp-admin/edit-tags.php?taxonomy=whoowns_source_types&post_type=whoowns_owner1,3151.9333.3834.84
All Owners /wp-admin/edit.php?post_type=whoowns_owner1,1792.0142.5828.45
New Owner /wp-admin/post-new.php?post_type=whoowns_owner2,7325.25104.6286.23
States /wp-admin/edit-tags.php?taxonomy=whoowns_geo&post_type=whoowns_owner2,5301.9334.6348.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_whoowns_shares
    • wp_whoowns_networks_cache
  • Zombie WordPress options detected upon uninstall: 29 options
    • whoowns_cron_ref_hour
    • whoowns_news_search_api
    • whoowns_geo_children
    • widget_recent-posts
    • whoowns_news_sources
    • whoowns_cron_frequency
    • widget_theysaidso_widget
    • can_compress_scripts
    • whoowns_default_related_owners_number
    • whoowns_default_shareholders_number
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 1
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 2
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 3
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 4
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 5
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 6
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 7
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 8
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 9
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 10
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 11
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 12
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 13
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+133
    Undefined offset: 14
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+163
    Undefined property: stdClass::$shareholder_name
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+166
    Undefined property: stdClass::$share
    • > GET request to /wp-admin/post-new.php?post_type=whoowns_owner
    • > Notice in wp-content/plugins/who-owns-your-country/admin.php+150
    Undefined variable: done

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
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.news.php
    • > /wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.main_actors.php
  • 51× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/who-owns-your-country/db_table.php:17
    • > PHP Notice
      Trying to get property 'link' of non-object in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.random_related_post.php on line 2
    • > PHP Notice
      Undefined variable: owner_data in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.main_actors.php on line 3
    • > PHP Notice
      Undefined variable: owner_data in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.main_actors.php on line 6
    • > PHP Notice
      Undefined variable: owner_data in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.main_actors.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function whoowns_set_loop_of_related_articles() in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.related_posts.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.news.php:11
    • > PHP Notice
      Trying to get property 'random_related_post' of non-object in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.random_related_post.php on line 2
    • > PHP Notice
      Trying to get property 'random_related_post' of non-object in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.random_related_post.php on line 2
    • > PHP Notice
      Undefined variable: owner_data in wp-content/plugins/who-owns-your-country/theme-files/layouts/single-whoowns_owner.factsheet.random_related_post.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=whoowns_geo&post_type=whoowns_owner
    • > Network (severe)
    wp-content/themes/twentytwentyone/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === who-owns-your-country === )
  • Screenshots: Add descriptions for screenshots #2, #3, #4 in who-owns-your-country/assets to your readme.txt
You can look at the official readme.txt

who-owns-your-country/whoowns.php 92% from 13 tests

"Who owns Your Country?" version 0.94's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("who-owns-your-country.php" instead of "whoowns.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
Good job! No executable or dangerous file extensions detected22,011 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript184,3932,18415,206
PHP184452703,316
CSS445671,663
PO File55366431,153
SVG211597
Markdown138076

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions123
▷ Named functions123100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
130 PNG files occupy 0.22MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/private-enterprise_16.png0.37KB0.24KB▼ 36.41%
images/colorUltController_32.png0.81KB0.34KB▼ 57.54%
images/stateRefSel_16.png1.87KB0.92KB▼ 50.52%
images/icon-person2.png5.22KB2.01KB▼ 61.49%
images/bckp/person_24.png0.75KB0.47KB▼ 37.40%