I would agree that there is a strong possibility of a hacked site with that code. The @file_put_contents statement is trying to write to your wp-admin folder. That’s not good.
So I would recommend a de-hacking inspection. If you think your site got hacked, there are several (many) things you must do to ‘de-hack’ it. Including:
- changing all passwords (WP admins, FTP, hosting, database)
- reinstalling WP (via the Updates page) and then reinstalling all themes (from the repository) and plugins manually.
- checking for unknown files (via your hosting File Manager; if you sort by date, invalid ones should stick out because you updated everything).
There are lots of help in the googles on how to de-hack a site. I wrote a set of procedures that I use. It can be done, though, just takes a bit of work.
Related Posts:
- How Attackers write script into my php files?
- Hacked WordPress website /Homepage redirect [closed]
- Troll the hackers by redirecting them
- malware undetectable by multiple scans
- How do I make an HTML table from a database table?
- dbDelta support for FOREIGN KEY
- How can I save a multiple select array with the settings API for a plug-in options page?
- Inject post (from specific category) between posts in Loop
- Transform php code into a widget?
- class=”parent” for wp_list_pages?
- PHP Script within wordpress theme
- if has theme mod
- wp_delete_auto_drafts() deletes links in menus
- Bulk Image upload and one image for each post?
- Remove css styles from specific page
- Why use %d in php when in function
- Submitting form via admin-post.php and handling errors
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Add to checkout total lines an additional line below shipping in WooCommerce
- Custom Loop through category menu to include sub categories
- Processing a subscription form with POST method?
- Get posts with at least one category in common with current post?
- Validate emails in array using foreach
- LESS compiler for WordPress
- Change the actual (or viewable) WordPress directory structure
- Get the the title of WordPress after comma
- Use WP_Query in shortcode
- Why is variable not working on custom sql query using wpdb?
- Variable global scope [closed]
- If post ID has_term?
- Ajax not working es expected (Returns 0)
- How do I ensure that a piece of hard code only gets called, when on my appointed Blog page?
- Apache /Ubuntu server not running WordPress installation, outputting PHP code like HTML
- WooCommerce Webhooks not firing because of error in wp-includes/meta.php
- Increase offset while looping
- WordPress PHP version won’t change from 5.2 [closed]
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- NGINX rewrite rules for multisite
- WordPress automatically adding comments to inserted PHP code how to disable? [closed]
- Plugin PHP file gives error 500 [closed]
- Site throws 500 error after upgrading from PHP 5.6 to 7.X
- Find a way to retrive data updated through metabox plugin to web page
- zip unzip attachments in wordpress
- Should i use the wordpress Options table or to create database table..?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Redirect first comment (Thanks for comment) with show Autor name and beginning of the comment
- Where are the src and srcset sizes coming from?
- Guttenburg and Classic Editor – How to use the custom guttenburg block in classic editor?
- How to get current post category details inside “loop”?
- Login to wordpress using another sites authentication.
- echo var into wp_query
- Using wordpress function to retrieve data
- Creating a child theme after numerous edits to parent theme
- Adding Additional Variables on Menus Page
- Admin Menu new tab external link
- Editing Theme Files on WordPress.com-hosted Site [closed]
- Editor capabilities – admin_init
- Download file and redirect to page or vice versa
- Password protect URLs
- Add Block Before Entry Title Using PHP
- How to correctly escape an echo
- Dynamically populate parameter in Gravity Forms using PHP
- Build A Custom SQL Query for WordPress Search
- I have a button in homepage theme in 2 language
- How to get specific multiple pages excerpts at homepage?
- Trying to get post ID outside loop on blog page
- Learndash: Customize user enroll time
- How to edit post meta data before publishing the post it self wordpress?
- Comments on my custom post type
- Including user data in “new user notification email”
- get Woocommerce product format json for WP_Query
- WordPress login with external php script
- Wp-query output correct, but the loop shows one less item (only sometimes)
- Get list of posts from attachment
- Refresh page after login with litespeed cache
- The plugin generated 225 characters of unexpected output during activation
- remove_action() not working in page template – Genesis
- Adding action item to admin users table and sending email
- Using get_the_excerpt in edit-post
- Create dynamic content from one WP page to multiple other pages
- ajax form with multiple submit buttons and values
- Property value of null when value is assigned inside a method hooked to the wp action hook
- Unserializeing multiple column values that are stored in one database results variable
- WordPress Errors after Host Migration
- WordPress – custom navigation item classes
- Keeps asking Connection Information upon update to 3.5.1 (but not for plugins?)
- How can I add more code to this?
- Display custom meta box in my template file
- wp_enqueue_style conflict when using in different action hooks
- WordPress developer
- If the_content’s string length is greater than 0, show post otherwise dont
- How do I update product shipping using PHP in WooCommerce?
- Use HTML Form Data in PHP Function – WordPress Admin Page
- Front-end major break after upgrade PHP 8.0 [closed]
- wp_enqueue_scripts with JS script as a string
- Why can’t I enter the wordpress admin interface?
- base64_encode conflict with convert_smilies in wordpress
- Correct way to perform a GET to another PHP file hosted on wordpress