Just don’t do it, you can never know if the plugins directory is even “below” ABSPATH, and you can not know the URL out of the directory path https://codex.wordpress.org/Determining_Plugin_and_Content_Directories.
Just use the core api of plugins_utl etc, don’t reinvent the wheel.
Related Posts:
- wordpress admin part is not accesbile after server shifting
- Apply function.php filter only if url not has /amp/
- How to route root path / to /xyz in nginx?
- I can’t load my images from a js file using wp_localize_script
- Right path for renaming a file in uploads folder
- Path for contact form file
- How to use plugins_url() inside PHP stylesheet file [duplicate]
- Is there a way to get a path to the theme directory without the server name?
- Contact form redirecting to page not found on send
- Setting custom cookies in WordPress
- Encode text string being appended as query to URL [closed]
- adding a filter to a shortcode?
- add_filter the_content str_replace after shortcode
- How to check if new posts have been published since page load?
- Permanently remove first image from posts
- Change the footer text on the login page
- How do I create a WP user outside of WordPress and auto login?
- WordPress will not operate correctly
- Copyright info change in Theme Child PHP
- post meta value as shortcode parameter
- Update WordPress Custom Field with AJAX on cached page
- Post from one loop in different containers?
- User Defined order on get_categories?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- WordPress doesn’t include css
- Create an array from an array
- How to add Shortcode (font awesome) in widget title?
- Continue execution after WP REST API response
- Does WordPress need the eval function?
- wp_mail not sending
- Returning a value from a PHP page
- PHP Date display as time ago
- Where would I place `wp_footer();`?
- Strip characters, Including spaces, for tel: link
- Can’t get page content in WordPress
- How can I add multiple ‘tax_query’ arrays via a loop?
- How to call plugin function per site in a multisite?
- How to Internationalize WordPress – Extract strings with textdomains, per textdomain individually
- How to make own crop image function for WordPress plugin
- 404 error when I acess the second page of post-type
- Where can I create a normal php file?
- Trying do build a contact form
- How to Disable WordPress Page Revisions?
- Prev/Next Links Broken on Static Front Page Pagination
- How to integrate noimage picture in this code
- Is there a built-in function to generate multiple paragraph tags based on a string with new line separators?
- Site downloads files instead of loading them
- Saving data from custom form in wordpress database
- How to add no follow to specific links?
- WordPress transient not working with WP Engine
- Basic wpdb update question
- Logout redirects to default page
- Remove conditional tag from header
- WordPress upload file size error even after raising php limits
- Find out last 7 days of upload images, last week uploaded image from Gallery and display them in different pages
- Add date before entry title in Twenty Twelve
- Multidimensional Array
- Disable Content Editor for Specific Pages
- GravityForms Limit Submission Per Time Period by User or IP by 30 minutes?
- Post class only applying to first excerpt; why?
- PHP Warning: preg_match() expects & PHP Warning: strip_tags()
- Limit the number of child pages
- Prevent post from being published and show error
- how to get wordpress page url php code [duplicate]
- Problems updating nested ACF field groups
- how to pull all usernames from a custom user role, then do some array modification
- Can I ‘order by’ date that is in a text field?
- Unable to delete related media attachments with deleted post
- How to retrieve taxonomy Metabox fields in frontend
- separate list of programs in html/javascript coming from php
- Is there a PHP function that will return the block ID generated by WordPress?
- retrieve “Link Color” value
- Creating a Function and Call It
- Adding column to wpex_users
- Issues adding Recaptcha v3 to WordPress Registration
- WordPress ajax filter returning all posts when it should be filtering by category
- WooCommerce Quantity in Dropdown menu instead of clasic [closed]
- Trying To Call a Dynamic Email Address
- Hide comment notification number and buttons in wp backend
- Create html tree sitemap
- meta field for numerous links
- Custom HTML form using PHP – help with ajax/username validation
- Where can I find the declaration of `$_wp_theme_features`?
- redirect 301 with special character like WIX site “#!”
- How I can add div to menu?
- Display tab title as ‘blog tagline | blog title’
- Conditional statement within WP SQL query
- How to print redirected query string variables to the page?
- Multiple URL from Custom post name
- Admin-area broken through weird issues
- Display a query with multiple post types and same relationship on a single page
- Get string from array and start loop [closed]
- Custom query_posts() parameter
- wp_link_pages return value even when is condition inside if statement
- How to quickly/easily make an analysis (reverse engineering) of WordPress?
- New to wordpress. Need Help with templates [closed]
- How to conditionally concatenate and translate two very long strings?
- Show post in elementor based on views and specific category with query id feature in elementor
- Registering a custom block style
- Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english