karpo518
Forum Replies Created
-
Forum: Plugins
In reply to: [Smart Slider 3] Auto proportional heightThanks for the deep dive into my problem.
I did some research on Smart Slider, Master Slider and MetaSlider plugins. You can see the results at https://laika.one/2279-testovaya-zapis/ All sliders are set to 2000×2000 px. As you can see, MasterSlider gave the result I wanted. Note the transition between slides 4 and 5 in this slider. This works thanks to the “auto-height” feature in the settings at https://joxi.ru/KAxdpVZfZaDWxA.
This is a great feature that helps solve the problem of different proportions. MetaSlider really behaves the same as your plugin.To summarize, I think that different proportions of slides is not a good way to provide content to users. But such a need may arise, for example, when you need to create a slider of screenshots from different devices. But you’ve given me a solution. If I don’t have the ability to do a cropped slider, I’ll use simple slides with a fill type of “By Size” and a gray background. I tested this technique on the 5th slide of your slider.
Overall, what I miss in your plugin is a quick mode that would allow you to edit descriptions for all slides on a single page. This is well implemented in MetaSlider. The slide description fields are also inconveniently implemented. In Master Slider I can use a kind of editor for big and complicated slide descriptions. But I also can’t help mentioning the advantages that your plugin gives. I will most likely use it in my project. I would prefer a plugin that allows you to quickly create sliders without leaving the Gutenberg editor. Some generic plugins with a set of blocks allow you to do this. But those blocks don’t have the settings I need. Not yet.
I still have one more question. Do you have a solution that will allow you to change the settings of all the previously created sliders at once? For example, I created 100 sliders and realized that the arrows should look different. In order to keep the same style of site design, I will need to change control settings for 100 sliders. This will require going into each slider and changing the settings within it. Is there any way to provide for this possibility before filling the site? It could be a settings template that is inherited by the sliders, or a mass settings editing feature. What are the options for this situation?
Forum: Plugins
In reply to: [Smart Slider 3] Auto proportional heightIf I understand it correctly, then creating the simplest slider turns into a complicated procedure. I have to create an empty slide and add an image layer to it. This is inconvenient. I figured that your slider is better suited if you need to create a lot of simple sliders. Maybe I was wrong. After all, in MetaSlider and Master Slider slides are added in one click. These sliders have automatic height by default.
Take a look at what became of my panel https://joxi.ru/VrwWy3Kf7600Br It is impossible to immediately understand what image is used in all the slides. The images and their names are not visible in the preview. To change the order of the slides, I have to open each slide and either act at random or manually type in the slide titles. This is time consuming if I need to create many sliders of the same type. Is there no way to simplify this?
There are extra indentations on the slider itself, and I don’t know how to turn them off https://joxi.ru/8An5aG4hzOE4G2 How do I do that?
Forum: Plugins
In reply to: [Smart Slider 3] Auto proportional heightThank you for your reply. I am using the free version of Smart Slider at the moment. I checked my first slider settings at https://laika.one/2171-smart_tv_televizory_pristavki_tizen_samsung_webos_lg_android_tv_apple_tv/
It does not work the way you describe.
The settings are 200px height and Boxed mode https://joxi.ru/12MP7zVig6bLGm
The result is that the height of the slider is not proportional and is 200px as specified in the settings. https://joxi.ru/BA0nQMyIMER71m
- This reply was modified 3 years, 1 month ago by karpo518.
Forum: Developing with WordPress
In reply to: Architecture of WordPress PluginThank you for the answer. I read this material, but there are no such details. I’m developing an administrative UI for my plugin. The Yoast Seo plugin has its administrative configuration pages in the administrative panel. So I have the opportunity to compare my administrative page code with Yoast SEO code.
Perhaps I am violating the basic principles of development in WordPress. I still want to organize a single login point for all my requests. The hookies are good for that. I studied the code of the https://github.com/tombenner/wp-mvc/ plugin for a long time, but I couldn’t figure out how it handles administrative queries in the admin_init hooks.
The add_menu_page function gives me a hard time. If the function just added a url to the administration menu, it would be logical. But the function takes on too many functions:
1. it sets a request handler for the URL
2. She registers the administration page to allow wordpress to access it.Also, it is the only way to legally create an administration page for my plugin. I will not ask how to register the page and not allow adding the page to the menu. This is a task I will have to solve in the future. Now I want to understand how to organize my code. Okay. I can use the callback function as a single entry point. And I’m trying to do that. I am talking about a function that I pass into add_menu_page. Surprise! You can’t do redirects in this function.
Okay. Then I want to transfer the dacian code of the plugin to a place where I can do redirects. It could be a hook admin_init. I add a hook for admin_init and write all the logic in it. That’s great. This is where you can put redirects. But now how do I link my code to admin_init and pukt in the administrative menu. I can’t use add_menu_page without the callback function. But this is not the only reason. Hook admin_init is triggered after admin_menu. So this bunch is impossible.
Now I’m thinking about another option. I place my plugin’s code in the plugins_loaded hook or no hook at all, i.e. in the code itself. Then I create a storage class by the singletone pattern. In my code, I fill the result variable. It will contain ready-made content for my administrative plugin page. I will have to use ob_start so that the template is not displayed. Then I use admin_menu hook and add_menu_page function. My callback function will take the result from the repository and display it on the screen. This is a very strange and complex solution, but I just don’t see how to solve the problem otherwise.
I hope you have understood me and will advise me a competent solution. Probably, the best thing that can help me now is understanding the life cycle of the wp-mvc plugin (admin pages). On the one hand, it executes its code in the admin_init hook. On the other hand, it uses the add_menu_page function. I do not understand how the author managed to make it work.
Forum: Developing with WordPress
In reply to: Architecture of WordPress PluginI use the WP_List_Table class to display and manage the table. But the functionality of my plugin is not limited to this. I want to use arbitrary url and process them. I’ve already realized that hook_redirect doesn’t suit me. I tried to use plugins_liaded or admin_menu hooks. I checked the hooks for GET parameters, identified the pages of my plugin, and performed the actions I needed. I can use these hooks to process requests, but what do I do with the resulting array of data? The wordpress template hasn’t been prepared yet, and I can’t show this data. I need to postpone this data and use it later when wordpress has prepared all blocks in the admin. I get the message “Error “Sorry, you are not allowed to access this page” on my plugin page.
I’m studying Yoast SEO plugin and I see a confusing system of callback functions there. I’m sure it’s much simpler than that. Now I expect to implement the following scenario:
1. I run /wp-admin/admin.php?page=my_plagin_name.
2. Other plugins don’t know this page, but my plugin checks $_GET[‘page’] and performs its action in the plugins_loaded hook. I get the data as a result.
3. I can’t render the output because the plugins_loaded hook is too early. It allows me to perform redirects, but it doesn’t allow me to display the data. I need to save this data temporarily. Where do you want me to save it? I don’t know.
4. In some other hook, I take my data from the temporary storage and display it in the admin. I don’t know which hook to use. I don’t know how to get the data prepared in step 2. That’s my current problem.Forum: Developing with WordPress
In reply to: Architecture of WordPress PluginOK. I will be brief and ask more clearly. I want to connect the database code given to the template_redirect hook. I will find a way to identify if my plugin page is being requested or not. Then I will get the necessary data. But I will need to transfer this data to the administration page of the plugin. Is there a wordpress way to pass an array from one piece of code to another? For instance:
I ran url /wp-admin/admin.php?page=my-plagin/admin/pages/queue.php
wordpress_redirect hook handler:
$admin_content = ['id'=>1, 'title' => 'test']; set_admin_data($admin_content);
queue.php
$admin_content = get_admin_data(); echo '<div class="id">'.$admin_content['id'].'</div>'; echo '<div class="title">'.$admin_content['title'].'</div>';
I hope that for such functionality there is something other than the global operator. Some kind of temporary storage for the plugin
Forum: Developing with WordPress
In reply to: Architecture of WordPress PluginI am creating a user interface for a custom directory in the administrative part of the site. It uses custom tables. For example, when you add a new item, I have to save it and redirect you to the list of items. WordPress forces you to use the request processing code directly on the plugin pages in the admin panel. These are several pages of the plugin in the admin panel. They contain catalog tables, forms, and other controls. On the same pages I am processing the request, although this should be done elsewhere. Let me give you an example, in the admin panel there is a page /wp-admin/admin.php?page=my-plagin/admin/pages/queue.php
Everything is located in the queue.php file: the logic for working with the queue entity, the template for outputting queue elements. All this in one file. It is bad architecture. I needed to set up a redirect in this file, but this is not possible. Putting request processing code in this file is incorrect. But then where to place them? And how to transfer information from the model to the template?
Forum: Plugins
In reply to: [Videopack] ERR_CACHE_WRITE_FAILUREThanks for help!
I have other problem now. I dont shure, that it is your plugin fault. I upload video to advanced custom field and select it. I upload thumbnail manually and select it. I get white screen(empty) modal form “Change file” with disable “update file” button https://joxi.ru/E2pW3VYf7VxOxm. I close modal form and open it again. It broken at first time only. I upload thumb and select it without closin form. It give me error. That problem in all versions of your plugin. I fix it repeated opening thubm select window. But it is not uncomfortable
Forum: Plugins
In reply to: [Videopack] ERR_CACHE_WRITE_FAILUREI think, your update brokes plugin. Plugin removes thumbnail after uploading. I have php error “PHP message: PHP Warning: filesize(): stat failed for /wp-content/uploads/2019/03/thumb_tmp/new_poster95.png in /wp-content/plugins/video-embed-thumbnail-generator/video-embed-thumbnail-generator.php on line 6509”