Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function track_event called incorrectly #237

Closed
1 task done
Sidsector9 opened this issue Apr 18, 2022 · 0 comments · Fixed by #250
Closed
1 task done

Function track_event called incorrectly #237

Sidsector9 opened this issue Apr 18, 2022 · 0 comments · Fixed by #250
Labels
bug Something isn't working
Milestone

Comments

@Sidsector9
Copy link
Contributor

Sidsector9 commented Apr 18, 2022

Describe the bug

We have a function called track_event used as a callback for the wp_after_insert_post action hook:

Hook

https://github.com/globeandmail/sophi-for-wordpress/blob/9526b72a5c84809d30096aaacff67fa9ffe5d808/includes/functions/content-sync.php#L30

Callback

https://github.com/globeandmail/sophi-for-wordpress/blob/9526b72a5c84809d30096aaacff67fa9ffe5d808/includes/functions/content-sync.php#L44

Usage outside of hook

This same function is also called using the wp sophi WP-CLI command in a standalone way but does not match the function signature:

https://github.com/globeandmail/sophi-for-wordpress/blob/9526b72a5c84809d30096aaacff67fa9ffe5d808/includes/classes/Command.php#L223

Steps to Reproduce

Running the following command will show a warning:

wp sophi sync --limit=1 --per_page=3 --post_types=post --include=<post-id-to-process> --dry-run=false

Screenshots, screen recording, code snippet

Warning caused by incorrect function signature:

Screen Shot 2022-04-18 at 3 51 35 PM

Environment information

  • Device: MacBook Pro
  • OS: macOS Big Sur
  • Browser: Chrome, 100.0.4896.88 (Official Build) (x86_64)

WordPress information

### wp-core ###

version: 5.9.3
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: local
user_count: 1
dotorg_communication: true

### wp-paths-sizes ###

wordpress_path: /Users/siddharththevaril/Local Sites/sophi/app/public
wordpress_size: 868.43 MB (910618889 bytes)
uploads_path: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content/uploads
uploads_size: 403.35 KB (413026 bytes)
themes_path: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content/themes
themes_size: 4.45 MB (4661340 bytes)
plugins_path: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content/plugins
plugins_size: 7.75 MB (8126789 bytes)
database_size: 2.11 MB (2211840 bytes)
total_size: 883.13 MB (926031884 bytes)

### wp-active-theme ###

name: Twenty Nineteen (twentynineteen)
version: 2.2
author: the WordPress team
author_website: https://wordpress.org/
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-thumbnails, menus, html5, custom-logo, customize-selective-refresh-widgets, wp-block-styles, align-wide, editor-styles, editor-style, editor-font-sizes, editor-color-palette, responsive-embeds, custom-line-height, amp, widgets
theme_path: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content/themes/twentynineteen
auto_update: Disabled

### wp-themes-inactive (1) ###

Twenty Twenty-One: version: 1.2, author: the WordPress team (latest version: 1.5), Auto-updates disabled

### wp-plugins-active (2) ###

AMP: version: 2.1.1, author: AMP Project Contributors (latest version: 2.2.4), Auto-updates disabled
Sophi: version: 1.0.11, author: 10up (latest version: 1.0.12), Auto-updates disabled

### wp-plugins-inactive (1) ###

Hello Dolly: version: 1.7.2, author: Matt Mullenweg, Auto-updates disabled

### wp-media ###

image_editor: WP_Image_Editor_GD
imagick_module_version: Not available
imagemagick_version: Not available
imagick_version: Not available
file_uploads: File uploads is turned off
post_max_size: 1000M
upload_max_filesize: 300M
max_effective_size: 300 MB
max_file_uploads: 20
gd_version: bundled (2.1.0 compatible)
gd_formats: GIF, JPEG, PNG, BMP
ghostscript_version: not available

### wp-server ###

server_architecture: Darwin 20.6.0 x86_64
httpd_software: nginx/1.16.0
php_version: 8.0.0 64bit
php_sapi: fpm-fcgi
max_input_variables: 4000
time_limit: 1200
memory_limit: 256M
max_input_time: 600
upload_max_filesize: 300M
php_post_max_size: 1000M
curl_version: 7.54.0 LibreSSL/2.6.5
suhosin: false
imagick_availability: false
pretty_permalinks: true
htaccess_extra_rules: false

### wp-database ###

extension: mysqli
server_version: 8.0.16
client_version: mysqlnd 8.0.0
max_allowed_packet: 16777216
max_connections: 151

### wp-constants ###

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content
WP_PLUGIN_DIR: /Users/siddharththevaril/Local Sites/sophi/app/public/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: local
DB_CHARSET: utf8
DB_COLLATE: undefined

### wp-filesystem ###

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

### amp_wp ###

amp_slug_query_var: amp
amp_slug_defined_late: false
amp_mode_enabled: reader
amp_reader_theme: legacy
amp_templates_enabled: post, page
amp_serve_all_templates: This option does not apply to Reader mode.
amp_css_transient_caching_disabled: false
amp_css_transient_caching_threshold: 5000 transients per day
amp_css_transient_caching_sampling_range: 14 days
amp_css_transient_caching_transient_count: undefined
amp_css_transient_caching_time_series: 
	20220417: 0
amp_libxml_version: 2.9.10

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jeffpaul jeffpaul added this to the 1.0.15 milestone Apr 18, 2022
@jeffpaul jeffpaul added the bug Something isn't working label Apr 18, 2022
@jeffpaul jeffpaul modified the milestones: 1.0.15, 1.0.14 Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants