OMG, finally, as the code runs from the plugin, the current working directory is set to wp-admin whereas when i run it manually it set for /wp-content/plugins…
So, when the push function is called, just add the following line of code:
chdir(ABSPATH . 'wp-content/plugins/*your plugins folder name*/');
Related Posts:
- wp_dequeue_style not working
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Adding a text domain to every __(), _e() and __n() gettext call without a plan to create own translations
- how to customize hello dolly plugin?
- Adding Custom Fields for Img in Posts
- Saving Plugin settings to the database
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- Deleting images through upload folder, but not deleting from media library
- How to restrict an entire WordPress site to visitors, but the register and login page?
- How to exclude a widget from page 1 of a paginated post
- WordPress plugin installation
- Adding a post shortcode to a page template?
- Sort products without thumbnail in WooCommerce shop page
- Create or Update thousands of woocommerce products via PHP
- send_headers don’t work on wordpress multisite
- Update Option Error: Notice: Undefined index
- The called constructor method for WP_Widget in GFWidget is deprecated since version 4.3.0! Use
- Self deactivate plugins after an action occurs
- wp_redirect() not working in Insert PHP plugin in WordPress
- How to put JQuery/Ajax inside shortcode?
- How can I add hyperlink in WP_Error message?
- How to save inputed data in a textbox [EDITED] [duplicate]
- Replace default og:image tag YOAST
- WordPress Widget Not Saving Data
- WordPress Payment gateway add on form , how to add form into list or else how to submit form to next step for payment
- Center and hide overflow of WP toolbar custom links
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Media Upload Tab reload and change $_GET
- How to define constant before plugin [duplicate]
- Use wordpress plugin in codeigniter
- Duplicate results are displayed in a custom plugin [closed]
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Only allowing some emails to create an account [closed]
- Basic function call on init failing
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- Help with WP Business Directory Manager Plugin?
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- I receive taxonomy id
- Is there a way to convert shortcodes to html content?
- Creating a functionality plugin to edit seriously simple podcasting
- Programatically upload a file to be stored inside blob field in database, NOT on filesystem
- How to change WooCommece variation data programmtically [closed]
- Make plugin php file called directly aware of WordPress?
- dynamically create callback functions inside a for loop
- Next Previous Post in wordpress with previous / next link with title?
- WordPress truncate posts question (plugin related)
- Different registration form for different roles
- WordPress Post HTML after Posting
- Settings options not showing up on Sub Menu page in WordPress plugin
- Cannot Access Console
- Plugin error after installation
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- woocommerce remove coupon link does not work
- Use a hook or filter, or overwrite this Gamipress function?
- Replace old theme that understand old css (vcex_icon_box css_animation)
- How to insert datas in the table on wordpress?
- WP Ajax DB issues
- ACF checkbox return format based on page
- How to get database connection details without longing to cpanel in WordPress?
- The Build menu theme is frozen with the wordpress theme
- Does anyone know why my SEO and title become one?
- How to translate wordpress blog to other languages?
- How to translate to spanish wordpress hardcoded content/files?
- How to get a post views count using ‘WordPress popular posts’ plugin
- Get Shortcode output to database for static post_content
- SimpleXML is not working with xml response from external api
- strtotime not working
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- How To Toggle User_Meta in frontend in a form using PHP
- Change Woo Custom Endpoint Titles from a Plugin
- Change custom rewrite rule when permalink is updated/changed
- No result after wpdb->insert
- Optimized PHP & WordPress settings for speed/performance?
- Speeding up WordPress on a Local Network
- How can I store user preferences in WordPress and retreive them later?
- Any method to make specific widget for every post and page?
- How to add php plugin code in theme
- how change my menu on submenu
- Plugin debugging with errors in activation routine
- Number format in thousands on highcharts in wpdatatable plugin
- Embed Javascript code to registered users only
- Find all strings between an enclosing shortcode
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- W3 Total Cache Can’t Really Detect Things
- How do I add php to all links automatically?
- Vote It Up Plugin – Add ascending numbers to MostVotedAllTime Chart Function
- How to fix vanilla comments extra iframe space
- Plugin use of ajax/jquery depending dropdown
- Meta Box plugin image_advanced not showing up on frontend
- Creating Features List in WordPress Post
- PHP Creating a formula from mysql db values and db stored math operator
- Refresh server side rendered block in Gutenberg without changing attributes or its content
- I want create woocommerec match products columns
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- How to override plugin function in code snippets WordPress
- How to create a “Most Popular” & “Latest” TAB in WordPress
- stop resize button for wordpress media
- Mixed results with is_page() WordPress function, when using $this, or self
- Custom Search Function in WordPress Returns No Results