How about working with a team that puts the worries of the virtual environment aside and makes this burden more attractive to you with its wide range of services?
Contact Now: +90 850 305 25 95
E-mail:info@margarit.com.tr
Address: İvoksan, Neva Home Offices
1455 Street, 22/41 Yenimahalle / Ankara

Common WordPress errors and solutions

margarit-web-reklam-bilisim-2020

No matter what theme you use, Woocommerce or not, WordPress plugins can present crazy problems when WordPress themes all go together. Considering that the WordPress CMS system, which is an open source infrastructure system, acts with millions of users, a worldwide delegation of manufacturers / developers and thousands of alternative applications; It doesn't seem likely that it will cause any problems.

In this article, we will try to cover a few of the standard and often annoying WordPress error notifications and WordPress error solutions that you may encounter as a WordPress user. We hope that the short-term solution plans will be partners in the solutions of the problems mentioned here, and you can accompany us with your comments.

WordPress You are not authorized to attach files to this post error solution

Very interestingly, it is translated as “You don't have permission to attach files to this post.” In other words, we are sharing code for the problem of "You are not authorized to attach files to this article" problem to archive and remember later.

To be able to intervene in the WordPress file operation authorization error wp-admin/includes/ ajax-action.php Below are the lines to be deleted from the file.

if ( isset( $_REQUEST['post_id'] ) ) { $post_id = $_REQUEST['post_id']; if ( ! current_user_can( 'edit_post', $post_id ) ) { echo wp_json_encode( array( 'success' => false, 'data', $post_id ) ) { echo wp_json_encode( array( 'success' => false, 'data' => You don&391; to attach files to this post." ), 'filename' => $_FILES['async-upload']['name'], ) ) ); wp_die(); } }

WordPress “Sorry, this file type is not allowed for security reasons.” error and solution

If you have been dealing with wordpress for a while and you are starting to push the limits, it is one of the mistakes you will definitely encounter.

To solve the problem, we will request permission by adding to your theme's functions.php file without interfering with the wordpress core.

I give the example for mp3 format, the rest is up to you; from this list You can have a look.

Code to add in WordPress file type error solution:

add_filter('upload_mimes','external_mimes'); function external_mimes($mimes){ return array_merge($mimes,array ( 'mp3' => 'audio/mpeg' )); }

If you are asking if there is more, you can follow the long list below.

Take a look at the codes for mime type definitions that can be used as an alternative in WordPress file type error resolution.

array( // Image formats 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', &#P339;139; ;bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'ico' => ' asx' => 'video/x-ms-asf', 'wmv' => 'video/x-ms-wmv', 'wmx'wmv' ;wm' => 'video/x-ms-wm', 'avi' => 'video/avi', 'divx' =>TP' video/x-flv', 'mov|qt' => 'video/quicktime', 'mpeg|mpg|mpe' => 'video/mpeg>4T4T39; /mp4', 'ogv' => &1 TP4T39;video/ogg', 'webm' => 'video/webm', 'mkv' => 'video/x-matroska', // Text formats 'txt|asc|c|cc|h' => 'text/plain', 'csv' => 'text/csv', 'tsv' => 'text/tab-separated-values', 'ics' => 'text/calendar', 'rtx' => 'text/richtext', 'css' => 'text/css', 'htm|html' => 'text/html', // Audio formats 'mp3|m4a|m4b' => 'audio/mpeg', 'ra|ram' => 'audio/x-realaudio', 'wav' => 'audio/wav', 'ogg|oga' => 'audio/ogg', 'mid|midi' => 'audio/midi', 'wma' => 'audio/x-ms-wma', 'wax' => 'audio/x-ms-wax', 'mka' => 'audio/x-matroska', // Misc application formats 'rtf' => 'application/rtf', 'js' => 'application/jаvascript', 'pdf' => 'application/pdf', 'swf' => 'application/x-shockwave-flash', 'class' => 'application/java', 'tar' => 'application/x-tar', 'zip' => 'application/zip', 'gz|gzip' => 'application/x-gzip', 'rar' => 'application/rar', '7z' => 'application/x-7z-compressed', 'exe' => 'application/x-msdownload', // MS Office formats 'doc' => 'application/msword', 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', 'wri' => 'application/vnd.ms-write', 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', 'mdb' => 'application/vnd.ms-access', 'mpp' => 'application/vnd.ms-project', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote', // OpenOffice formats 'odt' => 'application/vnd.oasis.opendocument.text', 'odp' => 'application/vnd.oasis.opendocument.presentation', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'odg' => 'application/vnd.oasis.opendocument.graphics', 'odc' => 'application/vnd.oasis.opendocument.chart', 'odb' => 'application/vnd.oasis.opendocument.database', 'odf' => 'application/vnd.oasis.opendocument.formula', // WordPerfect formats 'wp|wpd' => 'application/wordperfect', // iWork formats 'key' => 'application/vnd.apple.keynote', 'numbers' => 'application/vnd.apple.numbers', 'pages' => 'application/vnd.apple.pages', )

WordPress admin bar disappeared

The problem is unbelievably simple and emerges in annoying moments without you noticing.

You see, there is a space above with the admin bar, you are logged in, but instead of the bar itself, a space appears.

In this case, in footer.php in your theme files You should check if the line exists.

<?php wp_footer(); ?>

This line is in your theme&#039;s footer.php </body> It can be solved by placing it before the tag. Example footer.php ending should be:

</div><!-- /page -->
<?php wp_footer(); ?>
  </body>
</html>

How to bulk delete all media files and images on WordPress site with SQL?

You have thousands of derived files and you are lazy to clean wordpress installation.

To delete all media files with a single SQL code, simply use the code below.

I hope you can use it as a SQL query from the phpmyadmin panel.

 
DELETE FROM wp_postmeta WHERE post_id IN ( SELECT id FROM wp_posts WHERE post_type = 'attachment' ) ; # Second: DELETE FROM wp_posts WHERE post_type = 'attachment'

You won't forget to edit the wp_posts and wp_postmeta keys according to the prefix on your own site, right? 🙂

Remove sitelink from WordPress comments

I am adding it to keep it in the archive in a simple and short way, if it helps us, we will be happy.

function crunchify_disable_comment_url($fields) { unset($fields['url']); return $fields; } add_filter('comment_form_default_fields','crunchify_disable_comment_url');

functions.php Just add the following code to the file.
or comments.php Delete the following part from the file:

&#39;<p class="comment-form-url"><label for="url">&#039; . __vce( &#039;comment_website&#039; ) . &#039;</label>&#39; .
&#39;<input id="url" name="url" type="text" value="&#39; . esc_attr( $commenter[&#39;comment_author_url&#39;] ) .&#39;" size="30" /></p>&#39;

Also the code below for a neat view stlye.css add to file.

.comment-form-author, .comment-form-email { width:100%; }

WordPress slowness problem and slower with Woocommerce

As a Woocommerce user, if you have thousands of product ranges, unfortunately, you install many plugins for your cashier system and try to find a solution with Cache systems.

However, since Woocommerce is a system that appeals to the whole world, it is a system that compulsorily runs many unnecessary functions simultaneously. To alleviate this load, you can lighten the distribution of functions that you deem unnecessary, so that the features you do not use are not called by the system and save you speed / time.

The code I have given below into your theme's functions.php file Just add it, then you can delete the lines you want or you can add others. I'm sure you will gain a noticeable speed this way!

add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); function child_manage_woocommerce_styles() { //remove generator meta tag remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); //first check that woo exists to prevent fatal errors if ( function_exists( 'is_woocommerce' ) ) { //dequeue scripts and styles if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { wp_dequeue_style( ' woocommerce_frontend_styles' ); wp_dequeue_style( 'woocommerce_fancybox_styles' ); wp_dequeue_style( 'woocommerce_chosen_styles' ); wp_dequeue_style( 'woocommerce_prettyPhoto_css' ); wp_dequeue_script( 'wc_price_slider' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-add-to-cart' ); wp_dequeue_script( 'wc-cart-fragments' ); wp_dequeue_script( 'wc-checkout' ); wp_dequeue_script( 'wc-add-to-cart-variation' ); wp_dequeue_script( 'wc-single-product' ); wp_dequeue_script( 'wc-cart' ); wp_dequeue_script( 'wc-chosen' ); wp_dequeue_script( 'woocommerce' ); wp_dequeue_script( 'prettyPhoto' ); wp_dequeue_script( 'prettyPhoto-init' ); wp_dequeue_script( 'jquery-blockui' ); wp_dequeue_script( 'jquery-placeholder' ); wp_dequeue_script( 'fancybox' ); wp_dequeue_script( 'jqueryui' ); } } }
No Comments
Post a comment

en_USEnglish