77% publish-to-apple-news

Code Review | Publish To Apple News

WordPress plugin Publish To Apple News scored77%from 54 tests.

About plugin

  • Plugin page: publish-to-apple-...
  • Plugin version: 2.4.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Sep 16, 2015
  • Latest release: Mar 3, 2023
  • Number of updates: 134
  • Update frequency: every 20.4 days
  • Top authors: potatomaster (49.25%)kevinfodness (46.27%)beezwaxbuzz (5.97%)

Code review

54 tests

User reviews

24 reviews

Install metrics

5,000+ active /349,985 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.02MB] [CPU: ▼2.51ms] Passed 4 tests

This is a short check of server-side resources used by Publish To Apple News
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.65 ▲1.1845.18 ▲7.40
Dashboard /wp-admin4.55 ▲1.2059.58 ▼2.70
Posts /wp-admin/edit.php4.60 ▲1.2453.65 ▲5.46
Add New Post /wp-admin/post-new.php6.42 ▲0.5373.37 ▼20.19
Media Library /wp-admin/upload.php4.41 ▲1.1843.77 ▲10.55
Bulk Export /wp-admin/admin.php?page=apple_news_bulk_export4.3536.79
Settings /wp-admin/admin.php?page=apple-news-options4.3938.87
Articles /wp-admin/admin.php?page=apple_news_index4.4443.21
Automation /wp-admin/admin.php?page=apple-news-automation4.9444.58

Server storage [IO: ▲3.50MB] [DB: ▲0.05MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 162 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
apple_news_version
db_upgraded

Browser metrics Passed 4 tests

Publish To Apple News: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲3614.35 ▲0.161.79 ▼0.2344.23 ▼0.55
Dashboard /wp-admin2,225 ▲485.56 ▲0.0383.02 ▼4.3838.90 ▼2.55
Posts /wp-admin/edit.php2,133 ▲301.98 ▼0.0133.74 ▼6.3635.24 ▼2.53
Add New Post /wp-admin/post-new.php1,562 ▲3423.21 ▲0.01624.17 ▼55.8655.33 ▼4.76
Media Library /wp-admin/upload.php1,430 ▲334.16 ▼0.2394.66 ▼7.1639.92 ▼3.37
Bulk Export /wp-admin/admin.php?page=apple_news_bulk_export6931.126.5518.62
Settings /wp-admin/admin.php?page=apple-news-options1,3711.9129.0035.74
Articles /wp-admin/admin.php?page=apple_news_index1,0133.0839.0322.72
Automation /wp-admin/admin.php?page=apple-news-automation1,11211.24195.1527.73

Uninstaller [IO: ▲0.00MB] [DB: ▲0.05MB] 75% 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 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • apple_news_version
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=apple_news_bulk_export
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 81× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Apple_Exporter\\Components\\Component' not found in wp-content/plugins/publish-to-apple-news/includes/apple-exporter/components/class-title.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/publish-to-apple-news/admin/partials/cover-image.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/publish-to-apple-news/admin/class-admin-apple-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/publish-to-apple-news/admin/class-admin-apple-news.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/publish-to-apple-news/admin/partials/page-theme-edit.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Apple_News\\REST\\add_action() in wp-content/plugins/publish-to-apple-news/includes/REST/apple-news-update.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Apple_Exporter\\Components\\Component' not found in wp-content/plugins/publish-to-apple-news/includes/apple-exporter/components/class-cover.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Apple_Exporter\\Components\\Component' not found in wp-content/plugins/publish-to-apple-news/includes/apple-exporter/components/class-image.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Apple_Exporter\\Components\\Component' not found in wp-content/plugins/publish-to-apple-news/includes/apple-exporter/components/class-facebook.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Admin_Apple_Settings_Section' not found in wp-content/plugins/publish-to-apple-news/admin/settings/class-admin-apple-settings-section-post-types.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: publish, ios, news, apple

publish-to-apple-news/apple-news.php 69% from 13 tests

The entry point to "Publish To Apple News" version 2.4.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path should be prefixed with a forward slash character ("/lang/")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("lang/")
  • Main file name: Name the main plugin file the same as the plugin slug ("publish-to-apple-news.php" instead of "apple-news.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin17,091 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code
PHP1092,6708,68913,638
JSON7001,674
JavaScript191892101,033
CSS9761384
JSX52430362

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity17.72
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces10
Interfaces0
Traits0
Classes81
▷ Abstract classes44.94%
▷ Concrete classes7795.06%
▷ Final classes00.00%
Methods596
▷ Static methods9916.61%
▷ Public methods35960.23%
▷ Protected methods8714.60%
▷ Private methods15025.17%
Functions41
▷ Named functions2151.22%
▷ Anonymous functions2048.78%
Constants20
▷ Global constants00.00%
▷ Class constants20100.00%
▷ Public constants20100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 1.05MB with 0.45MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshots/colorful.png208.29KB100.92KB▼ 51.55%
assets/screenshots/pastel.png206.07KB104.44KB▼ 49.32%
assets/screenshots/default.png176.37KB107.06KB▼ 39.30%
assets/screenshots/dark.png205.70KB133.17KB▼ 35.26%
assets/screenshots/modern.png115.78KB72.56KB▼ 37.33%